I'm assembling a bunch of .tif
using Imagick. Everything is going good, except that the color depth of the output image is always reduced (16 on the input, 1 on the output). I'm using setImageDepth()
during the process, but it looks like it has no effect at all. Here's a snippet:
$imagick = new Imagick();
foreach ($_pile_of_tiles as $_index_to_append) {
$_tmp_buffer = new Imagick();
$_tmp_buffer->readImage($_index_to_append . ".tif");
$_imagick->addImage($_tmp_buffer);
}
$_imagick->resetIterator();
$_appended_images = $_imagick->appendImages(true);
$_appended_images->setImageFormat("tiff");
$_appended_images->setImageDepth(16);
file_put_contents("output.tif", $_appended_images);
That gives me a 1-bit image. I tried doing this using the command-line, and it works fine (-depth 16
).
Does someone encountered a similar issue?