JPEG and PNG questions

Moderator: jsachs

Post Reply
mjdl
Posts: 80
Joined: April 25th, 2009, 12:35 pm
What is the make/model of your primary camera?: Nokia N8-00

JPEG and PNG questions

Post by mjdl »

Maybe I've missed this in the documentation, but can I assume that if I open a JPEG already edited in PWP and change only the EXIF Comment or IPTC data, then the actual compressed JPEG image data will be essentially the same as the original JPEG when I save the file with the identical JPEG compression encoding and percent as the original, i.e. no image quality loss in principle?

As for lossless image formats, I often find that PNG is more space efficient for edited images than the various types of compressed TIFF, which makes it good for email and any other reason to save space. But PWP's PNG output does not support embedding the color space information associated with the output, nor textual information in the way that the JPEG/TIFF properties/output dialogs do. Is this a real limitation of the 3rd party image processing libraries that PWP uses, or can it be remedied in a future PWP version? (I wouldn't expect such a change in a maintenance release.) FYI, Exiv2 is another image metadata library that seems to support (on cursory reading!) these PNG features.
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: JPEG and PNG questions

Post by jsachs »

Repeatedly opening and saving a JPEG file will degrade the image. The higher the image quality, the more cycles you have to go through for the effects to accumulate to something visible.

The lack of profile and 16-bit image support for PNG files is a side effect of the 3rd party library we use. There is a freeware library LIBPNG available that would allow this, but we do not currently use it, although I have tried a couple of times and run into problems. Might be worth another try one of these days. Will also take a look at Exiv2.
Jonathan Sachs
Digital Light & Color
mjdl
Posts: 80
Joined: April 25th, 2009, 12:35 pm
What is the make/model of your primary camera?: Nokia N8-00

Re: JPEG and PNG questions

Post by mjdl »

Thanks for your answers!

I was a little leery of posing my question about the effects of JPEG uncompression/recompression, since degradation is the conventional answer I already know. But I was forgetting why that's the case: the JPEG compression process is not the inverse of JPEG uncompression process, each successive compression must cast away more data (I managed to convince myself otherwise while caffeine deprived).
doug
Posts: 111
Joined: April 24th, 2009, 10:06 am
What is the make/model of your primary camera?: Nikon D-500
Location: Toledo, Ohio USA

Re: JPEG and PNG questions

Post by doug »

Further on this topic:
I was pleased to see that Jonathan confirmed that the mere act of opening and re-saving a Jpeg triggers the lossy degradation, even if no edits were undertaken. That's because that was the underlying assumption behind an experiment I conducted when I first started using PWP nearly 12 years ago. I wanted to find out what this "lossy" characteristic everyone warned of was all about.

I opened a Jpeg and then, without making any edits whatsoever, saved it under a new name (say, "Copy 1"). Then I opened Copy 1 and saved it as Copy 2 without making any edits. I continued the process until I was many generations of sequential saves removed from my original Jpeg.

There is a function in PWP that allows you to overlay two image files and detect any differences on a pixel-by-pixel basis. The differences, if any, are rendered as a new image file. If there are no differences, the new image is totally black.

I started using this function to compare my original Jpeg with subsequent copied generations. The comparisons were totally black until I got to about the 10th generation of sequential saves. Then, a very faint latent image began to appear. After that, I started to worry a lot less about the "lossy" character of Jpegs.
mjdl
Posts: 80
Joined: April 25th, 2009, 12:35 pm
What is the make/model of your primary camera?: Nokia N8-00

Re: JPEG and PNG questions

Post by mjdl »

Thanks for reminding me about the image comparison feature of PWP, I really should have done that experiment before posting my question. As you suggested, the practical effects of re compression may be less than need to be concerned about, especially if done only a couple of times in succession. (It also reminds me of the utility of saving the workflow for individual images, so that work can be reopened from the original out-of-camera JPEG.)
Dieter Mayr
Posts: 453
Joined: April 24th, 2009, 11:47 am
What is the make/model of your primary camera?: Nikon D700
Location: Salzburg / Austria

Re: JPEG and PNG questions

Post by Dieter Mayr »

Maybe it should be said that the quality loss of JPEG only occurs when a image is opend and then saved again.
If you open a image, work on it, save it, make some other modifications, overwrite it or save it as a other version,
there will be no quality degradation between the two saves.
In Memory, the image is always a uncompressed bitmap, loss only occrs when saving, and only a multiple open - save cycle will accumulate the losses.

I have done that comparison of the accumulated losses too, as you described, and as long its only a hand full of consecutive opens and saves, I do not worry abot the losses.
Using a high quality factor (100%, in my case, of course).
As long as the resulting difference image appears black, it's ok for me.
I say appears because if you use Window - Count Colors it will give a value greater the 1 (if the image is really 100% black it will give 1 , because there is only RGB 0 0 0 as color)
Another way of enhancing the differences is using the Grey - Levels and Color transformation and click Full Range.
So you can really see where the loss happens, even at one open - save cycle ( but dont let it scare you, as long the untouches results image appears black, all is OK)
Dieter Mayr
Post Reply