PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Yet another PNG question

Please bear with me if this topic seems too naive or was asked before.

So its about PNG images, i know that the bytes required to decompress any PNG is always w*(h+1)*2, but is it regardless of what the quality of the image?

say if i got 2 PNG's of same dimension(say 15*15), one is good quality and the other is crap quality.

so memory needed during decompression would always be the same?
good(100k) - 15*16*2 = 480k
crap(20k) - 15*16*2 = 480k

am i right here? Thanks eveyrone!
Yes you are correct, quality does not matter. And this is one of the few cases where this actually is true. :)
haha thx so much Johan~

and what about the memory required formula of jpeg's? I know that the library will generate another copy of the image during decompression, so it's gonna be double like the following?

w*(h+1)*2*2

probably wrong I am just guessing, but please let me know :)

Thanks heaps guys!
Hi,

Actually, the image decompressor for JPG that is built-into most Pocket PCs require a 24-bit temporary bitmap. So the formula for all formats except PNG or BMP is:

w*h*2 + w*h*3

When the image decompression is done however, only w*h*2 is required.

Finally, BMP images require zero overhead (since I wrote it myself), so only w*h*2 is required to read any BMP image.
Thx Johan~ thats everything i wanna know! ^_^
one more and probably the very last question pls Johan!

what about the memory usage for gif's? again, it's the dimensions that matter but not the quality right?

Thanks indeeeeed!!!
GIF and JPEG have the same memory requirements...