Does converting image formats, such as from JPG to PNG, have any effect on image quality? I know converting from RAW to JPG has disadvantages, but what about other format conversions?
2 Answers
Going from JPG (which is a lossy format) to any lossless one (like PNG) does not.
Going from any format to a lossy one, yes, including JPG to JPG. It could be too little to notice, and using the same compression ratio loses a lot less on the second saving than on the first one, but yes, it is cumulative.
But beware... Some image formats store more information than others. For example, a CMYK JPG file will be ruined if you save it to an RGB-only file format, like PNG.
If you have something like transparency, you will lose it by saving in a file format that doesn't support transparency.
16-bit images will lose their extended range saving into an 8-bit per channel one, like saving a 16-bit TIFF image as a PNG.
Layers will be lost saving in almost any generic file format.
Effects could be lost saving as an older version of the native file format of some program, like Adobe Photoshop's PSD format.
If you drop the color profile, the image could render very different on some applications.
Some of this changes are not necessarily about "quality", but about the "information" inside the file.
-
1\$\begingroup\$ Beware that converting to PNG might retain all the image data but wipe out the EXIF. \$\endgroup\$ Commented Sep 6, 2018 at 16:02
I pretty much agree with Rafael on the following points:
Colorspace conversions will result in some losses (mainly rounding errors).
Decreasing color depth loses color information.
Transparency may be lost.
Layers and effects may be lost.
Metadata may not be preserved. (Even if a program doesn't remove any tags, most cannot help but to add something.)
However, regarding JPEG, I disagree somewhat.
The losses that result from repeatedly saving JPEGs at the same setting is limited. Eventually a steady state is reached where no further losses occur. I avoid saving over original out-of-camera JPEGs, but if it happens accidentally, it's not worth worrying about too much.
Saving from a JPEG to a lossless format does lose information, in particular, the invisible quantization tables used during the compression process. Losing this information prevents the use of future processing improvements, such as by JPEG decoders like knusperli and jpeg2png. If the only format your camera (phone) produces is JPEG, it is prudent to preserve that file as if it were a raw. See Is a JPG guaranteed to produce the same pixels?
-
\$\begingroup\$ I agree with your disagree :) I said "using the same compression ratio loses a lot less on the second saving than on the first one, but yes, it is cumulative" At what point? it probably needs an extensive trial and error investigation. \$\endgroup\$– RafaelCommented Sep 13, 2018 at 16:39
-
\$\begingroup\$ On the second point... I would blame the JPG and the rendering engine for that rounded information, not the saving on PNG, but true, you lose the different possibilities to be "reinterpreted" by a different rendering engine. But if you are using one application, for example, Photoshop, your original JPG would be reinterpreted the same way using the same JPG file, so that is not probably a real issue in this case. \$\endgroup\$– RafaelCommented Sep 13, 2018 at 16:39