[Digikam-users] png huge

Paul Hartman paul.hartman+gentoo at gmail.com
Mon Jan 18 19:50:52 GMT 2010


On Mon, Jan 18, 2010 at 9:43 AM, Martin Senftleben
<DrMartinus at drmartinus.de> wrote:
> Hi
>
> I have another thing that puzzles me: I've set digikam to store images
> as png, and always wonder how or rather why it makes out of a 2 MB jpg
> file a 10 MB png file, even though the png compression is set to its
> highest rate. Does png mean to increase file size by 5? Where does the
> additional info, that couldn't be in the jpg file, come from?

JPG is lossy, PNG is lossless.

> Please point me to the place where this is explained, in case it has
> been done already. I didn't find anything. Only the usual: jpg does
> lossy compression, png doesn't.

That's the correct answer. :) You cannot compare them. They are
completely different things.

> But I see it maybe too simple: The jpg file has a limited amount of
> info - uncompressed in a sense, because it's the original from which
> the png file is made. The png file now takes this info and then gets
> compressed to the maximum possible - yet it's 5 times larger.

An image of 100x100 pixels contains 10000 pixels of data. A PNG will
save all 10000 pixels exactly, and you will always be able to get the
original image every time.

A JPG saves an approximation of the original image. To a human eye, it
looks close enough to the original. But it's not the same, and never
will be. When you open the JPG your graphics program renders the JPG
to its own 100x100 image. When you save that as PNG, it's saving those
10000 pixels as PNG.

It's like asking why you can say a word with 1 character in Chinese
but 12 characters in German. Answer: because they are not the same. :)



More information about the Digikam-users mailing list