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
, 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:
Code: Select all
convert hdr_depth_clamp_example.tiff -level 9%,65%,1.5 -clamp -depth 8 convert-clamp-depth.png
, and looks as it should.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



