Issues with -clamp and -depth in HDR
Posted: 2013-04-20T13:17:54-07:00
I stumbled upon a problem with -clamp and -depth in the HDRI version of imagemagick, I'm not sure if I've understood the -clamp operation here, but I'll show the problem:
My original image is a scanned 16-bit TIFF image, resized to something manageable to show the problem: hdr_depth_clamp_example.tiff TIFF 108x160 108x160+0+0 16-bit DirectClass 105KB 0.000u 0:00.000
I want to apply a -level operation and then convert the resulting image to a 24-bit PNG:
This gives , obviously the darker-than-black has been wrapped to white for each channel, even though I specifically asked for -clamp.
I tried the exact same command with the plain Q16 imagemagick:
This gives , and looks as it should.
I did find a way around my problem by specifying PNG24:
This gives .
Have I misunderstood the meaning of -clamp or is it a bug?
convert-hdr:
My original image is a scanned 16-bit TIFF image, resized to something manageable to show the problem: hdr_depth_clamp_example.tiff TIFF 108x160 108x160+0+0 16-bit DirectClass 105KB 0.000u 0:00.000
I want to apply a -level operation and then convert the resulting image to a 24-bit PNG:
Code: Select all
convert-hdr hdr_depth_clamp_example.tiff -level 9%,65%,1.5 -clamp -depth 8 convert-hdr-clamp-depth.png
I tried the exact same command with the plain Q16 imagemagick:
Code: Select all
convert hdr_depth_clamp_example.tiff -level 9%,65%,1.5 -clamp -depth 8 convert-clamp-depth.png
I did find a way around my problem by specifying PNG24:
Code: Select all
convert-hdr hdr_depth_clamp_example.tiff -level 9%,65%,1.5 PNG24:convert-hdr-png24.png
Have I misunderstood the meaning of -clamp or is it a bug?
convert-hdr:
convert:Version: ImageMagick 6.8.4-9 2013-04-12 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC HDRI OpenCL OpenMP
Delegates: bzlib djvu fftw fontconfig freetype jbig jng jp2 jpeg lcms lqr lzma openexr pango png ps rsvg tiff x xml zlib
Version: ImageMagick 6.7.7-10 2012-08-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP