PNG image size changed

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

PNG image size changed

Postby sasuke » Sun May 04, 2008 2:49 pm

I have a PNG image with 86 KB in size and 8 in bit depth. But when i look at the image in the apk (bin folder), it's size changed to 193 KB and 24 in bit depth...

I don't even modify the image in my code.... what happened?

regards,
sasuke
sasuke
Experienced Developer
Experienced Developer
 
Posts: 57
Joined: Fri Nov 30, 2007 1:25 pm

Top

Postby Steel » Sun May 04, 2008 5:06 pm

I've had problems loading 8-bit PNG's at runtime using
Code: Select all
BitmapFactory.decodeStream(is);

It only seems to be able to decode 24-bit PNG's.
Steel
Developer
Developer
 
Posts: 48
Joined: Fri Dec 28, 2007 1:11 pm
Location: Herning, Denmark

Postby Steel » Sun May 04, 2008 5:25 pm

What the #"¤%£$? Some of my 8-bit png's in /res/drawable have been converted to 24-bit, but the ones with transparency have been converted to 32-bit :!:

Ah well, it seems some hidden part of the .apk generation script is to convert PNG's.
Steel
Developer
Developer
 
Posts: 48
Joined: Fri Dec 28, 2007 1:11 pm
Location: Herning, Denmark

Postby sasuke » Mon May 05, 2008 9:40 am

Hi steel,

taken from android developer group
http://groups.google.com/group/android- ... e3257471d8

hackbod wrote:aapt recompresses all PNG images as part of building the application's
resources. One of the purposes for this is to make sure they are as
small as possible, but clearly there is something broken here. :}


:cry:

regards,
sasuke
sasuke
Experienced Developer
Experienced Developer
 
Posts: 57
Joined: Fri Nov 30, 2007 1:25 pm

Postby Steel » Mon May 05, 2008 9:56 am

One of the purposes for this is to make sure they are as small as possible.


Should be:

One of the purposes for this is to make sure they are as compatible as possible


Remember the problems I had loading 8-bit PNG's at runtime :roll:
Steel
Developer
Developer
 
Posts: 48
Joined: Fri Dec 28, 2007 1:11 pm
Location: Herning, Denmark

Postby sasuke » Mon May 05, 2008 10:06 am

One of the purposes for this is to make sure they are as small as possible.


i don't think they made our image smaller.....
scary... :lol:
sasuke
Experienced Developer
Experienced Developer
 
Posts: 57
Joined: Fri Nov 30, 2007 1:25 pm

Top

Postby sasuke » Tue May 06, 2008 1:44 am

i've post a bug report : http://code.google.com/p/android/issues/detail?id=712

regards,
sasuke
sasuke
Experienced Developer
Experienced Developer
 
Posts: 57
Joined: Fri Nov 30, 2007 1:25 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 5 guests