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?

up vote 16 down vote accepted
  • 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
    Beware that converting to PNG might retain all the image data but wipe out the EXIF. – Mark Ransom Sep 6 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?

    Suppose we are taking a "picture" of an "image" on a number line: π (3.1415926535...). Suppose the "compressed" version is 7/22. Many original "images" could have resulted in the same 7/22 compression. 3.142...,3.144..., 3.138..., etc. Suppose someone uncompresses 7/22 and saves it as a "lossless" image, 3.142857142857143. Now it's stuck that way. But, if it were still compressed, someone with knowledge of the compression algorithm could have developed a decompressor that searches for the best "looking" image. Maybe something like 3.14159. It's not perfect, but it's closer to π than 3.142857142857143.

  • 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. – Rafael Sep 13 at 16:39
  • 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. – Rafael Sep 13 at 16:39

There are three main types of image formats:

Best format is RAW image format

RAW is a file format that captures all image data recorded by the sensor when you take a photo. (More detailed image)

When shooting in a format like JPEG image information is compressed and lost. Because no information is compressed with RAW you’re able to produce higher quality images, as well as correct problem images that would be unrecoverable if shot in the JPEG format.

Please see other image format details given below.

  1. Uncompressed (bit-map, a.k.a BMP) - storing the value of each pixel directly in a file. This way the image quality is maximal. - Good

  2. Lossless compression (TIFF, PNG): In an image there are some redundancies that can be exploited so that its representation in some file is smaller. For instance, if we seek constant areas and replace them with a single identifying symbol, then we have compression. This has the exact same quality as uncompressed (1), but the file size will be smaller. The compression here is done similarly to data file compression - we get a smaller file size but we have to get perfect quality (not data loss). Obviously, the file size here will be smaller than uncompressed but not significantly so (for a typical image). :- Loss image data

  3. Lossy compression (JPEG): This type of compression relies on image redundancies and distorts the data in favor of a smaller file size. The algorithms try to make the most visually pleasing way to distort, The file sizes here are significantly smaller than (1) or (2). Depending on the image content, the overall quality will vary from reasonable to almost indistinguishable from (1) or (2).:- Loss image data

  4. SVG format is a special purpose format that is designed for line art. Many SVG images can be zoomed into infinitely and never become blurry. :- Loss some of image data.

5.GIF format are limited to a palette of 255 colors. Complex images such as photos do not compress well under GIF due to the limited amount of colors. :-

  • 1
    This answer is very messy. You add in one basket vector and bitmap formats. And also very free mix categories and subcategories – Romeo Ninov Sep 5 at 14:28
  • 2
    Defining the types of formats is all good and fine, but the question asks about converting from one format to another. Please add into your answer the effects, and whether they are good or bad, of going from...BMP to PNG, for example. If you're going to define a format, might as well list the pros and cons of going both to and from that format as well. – Hueco Sep 5 at 15:16
  • The 2-3x compression that PNG typically achieves is certainly not insignificant. – Caleb Sep 5 at 15:32
  • 1
    This is a photography site. There is no need to discuss audio, video, or vector formats. – xiota Sep 6 at 3:44
  • "Because no information is compressed with RAW" Raw formats are compressed. Take a look at one folder containing different raw images from your camera. If they are not the exact same file size, they are compressed. The advantage of raw is not about the compression, it is about the unprocessed information. – Rafael Sep 13 at 16:33

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.