TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

IOS Image Tricks

90 pointsby gurgeousalmost 13 years ago

7 comments

bradleylandalmost 13 years ago
I'm being a bit picky here, but IOS is an operating system that runs on Cisco networking equipment. "Images" is how one refers to the software that is loaded on the switch/router/etc. For example, I can buy an "layer 3 enhanced image" for a Cisco switches that will give me limited routing capabilities.<p>For that reason, one should be careful about the case of the letters when referring to IOS and iOS, as they can lead to confusion if not used appropriately.
评论 #4303224 未加载
评论 #4303818 未加载
oofabzalmost 13 years ago
Using 16-bit images won't save any memory, and may actually use more memory. The iOS graphics pipeline requires 32-bit images for rendering, so all other types of images are converted to a 32-bit texture.<p>If you are trying to optimize memory consumption, you need to measure memory consumption! You can't just change some code and assume your memory consumption has gone down.
评论 #4304152 未加载
评论 #4304599 未加载
kstenerudalmost 13 years ago
You could compress those images down to 4bpp or even 2bpp by encoding to PVRTC. Since they're photorealistic images you'll retain image quality despite being 8x or even 16x smaller, and the graphics chip supports the format natively so you don't need to decompress it.<p>I use it in games whenever a photorealistic image is required. Some more info:<p><a href="http://www.uchidacoonga.com/2011/07/pvrtc-textures-and-cocos2d/" rel="nofollow">http://www.uchidacoonga.com/2011/07/pvrtc-textures-and-cocos...</a><p><a href="https://developer.apple.com/library/ios/#qa/qa2008/qa1611.html" rel="nofollow">https://developer.apple.com/library/ios/#qa/qa2008/qa1611.ht...</a>
评论 #4303533 未加载
0x0almost 13 years ago
Very interesting read, especially the image sprite part and how it improved cpu usage.<p>BTW:<p><pre><code> gIsLowCPU = [gModel matches:[NSRegularExpression re:@"^(iPhone1|iPod[12])"]]; </code></pre> this is gonna be fun when the iPhone 10 is released!
评论 #4303173 未加载
评论 #4303707 未加载
kallebooalmost 13 years ago
I remember back in the day of 60 MHz PowerPC with 16 MB RAM, that I used software that would decode JPEG files in blocks, so you could look at high-res photos without holding the whole uncompressed image in RAM. In fact, I have an app like that for my Android phone for viewing a very high res bike route map I rendered out of a PDF.<p>Are there any libraries like that floating around that would work in this situation?
campnicalmost 13 years ago
So, it sounds like 'spriting' in this context is a way of sending a stitched together larger image and then showing a portion of it in each uiimage. I work on Android, and I'm interested in the technique but just was looking for some validation before I go off doing research.
nutjob123almost 13 years ago
Here's a tip when you start working on android. There is a method in the bitmap factory class that can handle image scaling for you on device.