Page 1 of 1

Image optimization

PostPosted: Mon Nov 21, 2011 5:00 pm
by Hblade
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.

Re: Image optimization

PostPosted: Mon Nov 21, 2011 5:14 pm
by SuperSonic
Neet tutorial. Thanks :D

Re: Image optimization

PostPosted: Mon Nov 21, 2011 7:18 pm
by Game A Gogo
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:

Re: Image optimization

PostPosted: Mon Nov 21, 2011 7:45 pm
by Hblade
Oh, :(

Re: Image optimization

PostPosted: Mon Nov 21, 2011 8:58 pm
by Game A Gogo
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:

Re: Image optimization

PostPosted: Mon Nov 21, 2011 9:48 pm
by Hblade
Oh gawsh! I never thought of that. :)

Re: Image optimization

PostPosted: Mon Nov 21, 2011 10:05 pm
by SuperSonic
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 :)

Re: Image optimization

PostPosted: Sat Dec 17, 2011 9:23 pm
by Hblade
They don't? o-o

Re: Image optimization

PostPosted: Sat Dec 17, 2011 11:43 pm
by SuperSonic
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

Re: Image optimization

PostPosted: Sun Dec 18, 2011 1:12 am
by Hblade
xD! strange

Re: Image optimization

PostPosted: Sun Dec 18, 2011 10:26 pm
by SuperSonic
Hblade wrote:xD! strange

yeah :D

Re: Image optimization

PostPosted: Tue Dec 20, 2011 3:35 pm
by Jagmaster
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.

Re: Image optimization

PostPosted: Tue Dec 20, 2011 3:39 pm
by Hblade
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.

Re: Image optimization

PostPosted: Tue Dec 20, 2011 4:07 pm
by Jagmaster
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. :)

Re: Image optimization

PostPosted: Tue Dec 20, 2011 4:21 pm
by Hblade
Alright =)

And well, images have different ways to compress. GIFs can hold frames and animations in 1 image, this allows effects like this: