Convert 16-bit-TIFF to 8 bit image changes colors and leads to massive loss in quality

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dirkhillbrecht
Posts: 2
Joined: 2017-10-09T13:05:23-07:00
Authentication code: 1151

Convert 16-bit-TIFF to 8 bit image changes colors and leads to massive loss in quality

Post by dirkhillbrecht »

Hello everyone,

I use ImageMagick as included in Ubuntu 16.04:

Code: Select all

Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-07-31 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
I have a 16 bit image as TIFF file (9 MB):

https://downloadcenter.hillbrecht.de/IM ... alized.tif
Image

I convert this image into an 8 bit format. I use

Code: Select all

convert IMG_7816_K_normalized.tif -quality 80 -depth 8 IMG_7816.JPG
for this, but the result is the same if I leave the "-depth", set "-quality" to something other reasonable, or convert into PNG format. The result looks like

https://downloadcenter.hillbrecht.de/IMG_7816.JPG
Image

There is a massive decrease in quality and the colors are visibly shifted. It seems that the noise of the original image is massively amplified which can be seen especially in the dark tunnel entry in the background. (The noise after all comes from the image's source which is a photographed film negative.)

I understand that 16-to-8 bit conversion means a loss in quality, but this seems a bit strong. What am I doing wrong? How can I increase the quality of the resulting file?

Any hint would be greatly appreciated.

Best regards,
Dirk
dirkhillbrecht
Posts: 2
Joined: 2017-10-09T13:05:23-07:00
Authentication code: 1151

Re: Convert 16-bit-TIFF to 8 bit image changes colors and leads to massive loss in quality

Post by dirkhillbrecht »

Well, after some testing: Seems that "-colorspace RGB" does the job. The resulting JPG has the expected quality: Minimally lossy compared to the TIFF but generally equal in color and noise.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert 16-bit-TIFF to 8 bit image changes colors and leads to massive loss in quality

Post by snibgo »

dirkhillbrecht wrote:Seems that "-colorspace RGB" does the job.
That is a symptom of a very old version of IM. I suspect you don't really have v6.8.9-9, but actually an older version that has been partially patched.

With an official release of v6.9.5-3, I don't get the problems that you have.
snibgo's IM pages: im.snibgo.com
Post Reply