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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-27-2010, 07:23 AM   #1 (permalink)
Divine avenger
 
Johanovski's Avatar
 
Join Date: Nov 2009
Location: Vic, Catalunya (Spain)
Posts: 320
Default OpenGL: PNG vs JPG

Hi there!

I'm trying to small down my app's size and first thing I've done is to convert non-transparent PNGs (like backgrounds) to JPGs (which weights a lot less). Is there any problem doing this? Is this going to cause my app to load textures slower or make it draw them harder (so, is there any optimization problem using JPG textures in OpenGL instead of PNG)?

Thanks a lot!
Johanovski is offline   Reply With Quote
Old 01-27-2010, 07:44 AM   #2 (permalink)
Maker of Games
 
Mr Jack's Avatar
 
Join Date: Nov 2009
Location: Coventry, UK
Posts: 395
Default

Surely you convert whatever image you load into an OpenGL native format as soon as you load anyway? So it won't make any performance difference - as for load time, it should be lower with the smaller JPEG files. However, JPEG compression is not lossless so you may experience a drop in image quality.

Personally I pre-process my images, and compress with zlib, into a format suitable for the game and OpenGL rather than using either format.
__________________


Visit Mr Jack Games for my blog and more about my games
Mr Jack is offline   Reply With Quote
Old 01-27-2010, 10:13 AM   #3 (permalink)
Pro. Game Developer
iPhone Dev SDK Supporter
 
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 2,178
Default

Quote:
Originally Posted by Mr Jack View Post
...as for load time, it should be lower with the smaller JPEG files...
The time spent doing the actual I/O of loading the smaller file should be less, but might there be an increase in time doing the JPG decoding?

If overall app size is your primary concern, you probably want JPG (assuming you're OK with the whole lossy aspect), though I suspect your texture load times, from start to finish, may be greater than if using PNG. Just my theory; you should run your own tests to verify what works best for you.
__________________
~~ Word Flurry ~~ App Store / Website / Facebook
Kalimba is offline   Reply With Quote
Old 01-27-2010, 10:39 AM   #4 (permalink)
Maker of Games
 
Mr Jack's Avatar
 
Join Date: Nov 2009
Location: Coventry, UK
Posts: 395
Default

Quote:
Originally Posted by Kalimba View Post
The time spent doing the actual I/O of loading the smaller file should be less, but might there be an increase in time doing the JPG decoding?
Aye, there might be, and I've not tried JPG specifically. However, my experience with compression and iPhone leads me to believe that the time take to decode will be considerable less than the decrease in load time, using zLib to compress my textures certainly gained me a substantial speed up.

I think the processor and main RAM are just that much faster than the main flash storage.
__________________


Visit Mr Jack Games for my blog and more about my games
Mr Jack is offline   Reply With Quote
Reply

Bookmarks

Tags
alpha, jpg, opengl, opengles, png

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 256
23 members and 233 guests
@sandris, ADY, Dani77, diyora, FAED, fredidf, F_Bryant, HDshot, iDifferent, JamesCahall, JasonR, mer10, Oral B, prchn4christ, Rudy, smithdale87, Speed, spiderguy84, stekki, tgjorgoski, Touchmint, twerner, vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,754
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:07 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0