First, which version of ImageMagick am I using?
Code: Select all
$ convert --version
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib
Code: Select all
$ convert -size 256x256 gradient:red1-green1 -colorspace RGB original.png
Code: Select all
$ convert hald:16 hald16.png
Code: Select all
$ convert original.png hald16.png -clut result.png
result.png should look identical (or at least nearly so, allowing for rounding errors or interpolation) to original.png.
Actual result
result.png looks different to original.png. original.png has a smooth gradient from red to green. result.png looks like a psychedelic barcode: instead of a smooth gradient, it has bands of red, bands of green, and bands of black.
Is this a bug in that version of ImageMagick, or have I done something wrong?