Newbie doubts about png and jpeg

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, helmut, xnview

beto
Posts: 3
Joined: Tue Apr 12, 2005 12:29 am

Newbie doubts about png and jpeg

Post by beto »

I know that this is a complete noob question, but bear with me... I am learning :D

If I save a PNG file as interlaced will quality be sacrificed compared to a non interlaced version? I tested and sizes are different for the same pixel depth and same width/height.

What about progressive jpeg versus regular? The sizes are also different...

Thanks.
User avatar
xnview
Author of XnView
Posts: 44448
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Newbie doubts about png and jpeg

Post by xnview »

beto wrote:I know that this is a complete noob question, but bear with me... I am learning :D

If I save a PNG file as interlaced will quality be sacrificed compared to a non interlaced version? I tested and sizes are different for the same pixel depth and same width/height.

What about progressive jpeg versus regular? The sizes are also different...
PNG is a lossless format even if you use interlaced and different compression value.
JPEG is a lossy format progressive or not.
Pierre.
Guest

Post by Guest »

Sorry, I wasn't very clear... :wink:

What I meant is comparing PNG interlaced versus PNG non-interlaced and JPEG progressive versus JPEG non-progressive using the same image source.

From your reply I understand that for PNG I will be able to restore the original image source losslessly no matter if I compressed it with PNG interlaced or PNG non-interlaced. Is this correct? The doubt arised because compressing the same image source with PNG interlaced gave me smaller file sizes than compressing it with PNG non-interlaced for the same compression level...

Regarding JPEG what I wanted to know is if JPEG progressive is "more lossy" than JPEG non-progressive for the same image source.

Thank you for your replies.
beto
Posts: 3
Joined: Tue Apr 12, 2005 12:29 am

Post by beto »

The reply above is mine. I forgot to login before I post it. Sorry... :?
User avatar
xnview
Author of XnView
Posts: 44448
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Post by xnview »

Anonymous wrote:From your reply I understand that for PNG I will be able to restore the original image source losslessly no matter if I compressed it with PNG interlaced or PNG non-interlaced. Is this correct? The doubt arised because compressing the same image source with PNG interlaced gave me smaller file sizes than compressing it with PNG non-interlaced for the same compression level...
Data can perhaps be compressed more when interlaced, but it's lossy.
Regarding JPEG what I wanted to know is if JPEG progressive is "more lossy" than JPEG non-progressive for the same image source.
No it's the same. Progressive jpeg write original picture + pictures at different resolution.
Pierre.
beto
Posts: 3
Joined: Tue Apr 12, 2005 12:29 am

Post by beto »

xnview wrote: Data can perhaps be compressed more when interlaced, but it's lossy.
Did you really mean lossy here? :?
xnview wrote:No it's the same. Progressive jpeg write original picture + pictures at different resolution.
ok. thank you Pierre.
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Post by Drahken »

1) PNGs are always lossLESS, regardless of interlaced or not. In most cases, interlacing will increase the filesize, but in some it may reduce it. Interlacing saves the file in a slightly different fashion than non-interlacing and thus results in a different filesize, but it does not change the fact that PNG is lossless. An interlaced PNG and a non-interlaced PNG created from the same source image will be pixel-perfect identical to each other.
(Note: There are some experimental "lossy" png compressors floating around, but these still save lossless files. The loss in these so-called "lossy" PNGs is done before actually creating the file.)
2) The same is essentially true for progressive/non-progressive JPGs. There is no increased loss regardless whether you save the image as progressive or non-progressive. Again, the difference lies only in how the program layers the data within the image file. This results in a different filesize, but no difference within the visible image. Progressive JPGs differ from interlaced PNGs in that a progressive JPG is usually smaller than a non-progressive one. (Unless you are dealing with a very large image, then the non-progressive will usually be smaller.)

In short, the only difference between interlaced/progressive and non-interlaced/non-progressive images is how they display as they're loading, and a minor difference in filesize. Quality is not affected one way or the other.
Guest

Post by Guest »

thank you for the clarification!! :D
User avatar
xnview
Author of XnView
Posts: 44448
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Post by xnview »

beto wrote:
xnview wrote: Data can perhaps be compressed more when interlaced, but it's lossy.
Did you really mean lossy here? :?
Sorry lossless ;-)
Pierre.