Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Compress PNG

Author
Message
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 22nd Jan 2015 23:08 Edited at: 22nd Jan 2015 23:23
Hi

I want compress my PNG files fot decrease APK size and usage memory after load Pictures.Now I want Know if I compress my PNG files don't exist any problem for run on different devices?

Thanks
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 23rd Jan 2015 00:39
Quote: "I want compress my PNG files fot decrease APK size and usage memory after load Pictures"


Storing image media as PNG files generally won't alter the applications run time memory usage. This is because, when a file is loaded from disc to memory, it's decompressed into the devices pixel format of choice. So even though a picture might be stored as say 8bit (256 colour), when it's loaded it's decompressed to 32bit colour. This is easier for the decide to deal with.

paulrobson
10
Years of Service
User Offline
Joined: 22nd Nov 2014
Location: Norfolk, England
Posted: 23rd Jan 2015 10:48
With AppGameKit you can scale and expand the sprites to suit. So you could (say) reduce some of your image sizes by half, then rescale it back up. The problem with this is, of course, lost detail.

The best way I reckon to do this is to acquire from some friends or family some unused phones, Android devices especially can be got pretty much for free. You can then see how well your code works on lower powered devices ; there's no point in testing on Windows, an iPad and a Nexus 7. The graphic throughput (on say the benchmark demo) between devices is quite significant.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 23rd Jan 2015 11:09
To expand on the good advice above, AppGameKit images will always be 32 bits per pixel. By compressing your images you actually slow down your app while it is loading the image and converting it back to an uncompressed image.

Quidquid latine dictum sit, altum sonatur
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 23rd Jan 2015 11:13
Ok,I Understood. Thanks All for help.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 23rd Jan 2015 14:40
Consider using Atlas images too and perhaps something like Spine if animating sprites to reduce the amount of media required.

V2 T1 (Mostly)
Uzmadesign
paulrobson
10
Years of Service
User Offline
Joined: 22nd Nov 2014
Location: Norfolk, England
Posted: 23rd Jan 2015 14:45
IME 8 bit quantization is not that brilliant. It is also important to be sensible about these things. If you have audio, music or especially video these are likely to occupy far more memory than an image.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 29th Jan 2015 11:15
Png uses lzw compression. Things like photos or images with gradients takes up a lot more space. Also, compressing to 8 bit or 16 bit instead of 32 bit can save a lot of space. So if you are looking to shrink the actual apk size and your images are large then look into this.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 30th Jan 2015 23:50
use PNGgauntlet

Login to post a reply

Server time is: 2024-11-25 17:53:36
Your offset time is: 2024-11-25 17:53:36