Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 12-05-2008, 06:34 AM   #2 (permalink)
Karl Kraft
Coder for Life
 
Karl Kraft's Avatar
 
Join Date: Sep 2008
Location: Austin, TX
Posts: 76
Karl Kraft is on a distinguished road
Send a message via AIM to Karl Kraft
Default Do the opoosite, make large image from small ones

Quote:
Originally Posted by Norbert View Post
Our Xcode project holds a large image (.gif, about 4700x3100 pixels, 6MB). The file cannot be made smaller because we need this resolution.
No, you don't need this resolution. The phone can't display an image larger than 480x320, since that is the size of the screen. The best way to fix your problem is by breaking it into tiles no larger than 480x320, and then drawing the tiles that would be visible at any given time.

Right now your image would consume over 58 million bytes of memory on the phone once it has been decompressed, which is neeed to make it displayable. The 6MB size you quote is the compressed size (GIFs are compressed), UIKit needs to decompress the GIF into RGBA (GIFs can have transparency) in order to diplay on screen. 4700*3100*4(RGBA) = 58,280,000.



By tiling it into 480x320 segments, you would never need more than 4 segments loaded at a time, or 2.4MB of memory (480*320*4*4) = 2,457,600. If the image doesn't need to be transparent and you switch it to a PNG you could get that down to 1.8MB. And depending on the particulars of your application you could get it down a bit more.
Karl Kraft is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,599
Threads: 94,084
Posts: 402,781
Top Poster: BrianSlick (7,990)
Welcome to our newest member, bbbsaha
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:46 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.