Image optimization

How to find or create sprites, graphics, sounds and music.

Image optimization

Postby Hblade » Mon Nov 21, 2011 5:00 pm

Optimize your images using this method. (This tutorial was originally for iOS games)

Programs needed:

Regular: (128.39KB)
Image

Compressed: (110KB) (I know, not that big-a-difference, but its a gradient, contains lots of hex-data)
Image


Swirl Regular: (68.24KB)
Image

Swirl Compressed: (52.67KB) Again, not a giant drop, but also contains tons of hex-data. Using this method may speed the games FPS up by maybe up to 10.
Image



Swirl in 16 bit: (39.69KB) (cant tell a difference)
Image



To save to 16 bit, you have to make a copy file and save it as a .bmp then click advanced options, and select 16 bits, (R5, G6, B5), or something like that. Then you have to re-open that image (The BMP one), and re-save as .png with compression settings.

Basic background with little-hex data:
Stars(813 bytes) this is less than 1 KB
Image

Stars Compressed(707Bytes) Also less than 1 KB, optimized too, but as you can see it appears to be a green image. This is because I changed the black to green, and its STILL optimized
Image

Complete optimization for stars: (372 bytes)
Image


Final Optimization with Great looks: (5.49KB) -- Including Alpha Chanel
Image

Final optimization without alpha channel (5.06KB)
Image

Optimizing these images will certainly help with the performance I hope =)

Also, the top left corner of that image, is a green pixel that you cant see. This will regester as the transparent pixel in game editor.
Attachments
logo.png
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Image optimization

Postby SuperSonic » Mon Nov 21, 2011 5:14 pm

Neet tutorial. Thanks :D
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: Image optimization

Postby Game A Gogo » Mon Nov 21, 2011 7:18 pm

As far as I'm concerned, GE will transform the images into a specific format when it's exported to be encoded in the executable, so I don't think this will help performance S:
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Image optimization

Postby Hblade » Mon Nov 21, 2011 7:45 pm

Oh, :(
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Image optimization

Postby Game A Gogo » Mon Nov 21, 2011 8:58 pm

Correct me if I'm wrong, but wouldn't compressed image take more power to uncompressed? Unless they are loss less compression I suppose like simple bbp change. I'd like clarification on this matter too, I'm not sure of the information I'm providing S:
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Image optimization

Postby Hblade » Mon Nov 21, 2011 9:48 pm

Oh gawsh! I never thought of that. :)
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Image optimization

Postby SuperSonic » Mon Nov 21, 2011 10:05 pm

Game A Gogo wrote:As far as I'm concerned, GE will transform the images into a specific format when it's exported to be encoded in the executable, so I don't think this will help performance S:

That explains why some of my images don't look right when I export my game :)
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: Image optimization

Postby Hblade » Sat Dec 17, 2011 9:23 pm

They don't? o-o
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Image optimization

Postby SuperSonic » Sat Dec 17, 2011 11:43 pm

Hblade wrote:They don't? o-o

No. For example, I used gimp to put a lense flare on a background but then when I exported the game, the shading on the flare was no longer smooth. Instead it looked all chunky and ugly and stuff :P
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: Image optimization

Postby Hblade » Sun Dec 18, 2011 1:12 am

xD! strange
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Image optimization

Postby SuperSonic » Sun Dec 18, 2011 10:26 pm

Hblade wrote:xD! strange

yeah :D
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: Image optimization

Postby Jagmaster » Tue Dec 20, 2011 3:35 pm

Now, I got some questions regarding this whole image optimization.

I have a set of six images that are 3254 by 2550, (It was the size of the copy paper I scanned with a weird resolution)
3 are visual and 3 are collision masks.
The collision masks are set to don't draw only.

For the cpu's sake, would it be better to have the images cut into quarters and then cloned? I wasn't going to tile for canvas's sake. Not necessarily going to draw them in canvas, but I want to leave those doors open just in case. Or should I just leave them whole? I'm mainly concerned about the visual images. I bench-mark tested the collision masks, and there was no spike in performance. On the other hand, the visual actors started to spike with three or four clones. Since I have three already, and my cpu is almost maxed with that going on, I don't want it to lag elsewhere in the game with all those resources tied up with the images alone. The visuals have an alpha channel too, I don't know if that makes much of a difference or not.

I also want to know, since the compressed image (png) is like 2.5 megabytes and the uncompressed is around 30 megabytes. With that amount of difference, If I do have an image that size and compress it, will the .exe be 30 megabytes larger than I thought?

Thanks in advance.
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score

Re: Image optimization

Postby Hblade » Tue Dec 20, 2011 3:39 pm

Well in this case, after exporting, Game Editor prettymuch optimizes it's images on its own, so I think you should be good. Even an old computer will be fine with what your doing :3 However if opened in GED mode, it will lag probably xD but after exporting, it should be fine.

thats like a GIF animation I had, 640x480, 100+ frames. It took a frekn' year to open the GED file xD but exporting, its optimized.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Image optimization

Postby Jagmaster » Tue Dec 20, 2011 4:07 pm

Thank you for that information.
So I'd be safe leaving it as is? I'll do a test on an .exe to be sure.
Are GIFs easier to process than PNGs? I wonder how that all works with the indexed colors and such. Either way, I'm sticking with PNGs.

It's kinda weird, some games such as Darkboy 3D are really slow and jittery in the editor, but when exported to .exe, it runs quite smoothly. (Anyone who hasn't tried exporting that game should play it in .exe format. It's beautiful, no lag.) However, I've tried to test that principal on some of my work and it didn't work like that. :lol:

I'll hope for the best this time around. I'll tell you what happens when I test it. :)
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score

Re: Image optimization

Postby Hblade » Tue Dec 20, 2011 4:21 pm

Alright =)

And well, images have different ways to compress. GIFs can hold frames and animations in 1 image, this allows effects like this:
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to Game Resources

Who is online

Users browsing this forum: No registered users and 1 guest