So, i have a lot of tiff files and I want to generate thumbnails of them. This thumbnails must have a transparent background.
All tiffs have: a white background and a path along the object (e.g. a can of a coke) and are saved as CMYK.
So i tried a lot of convert
commands (like these and also php Imagick::clipPath
but nothing worked very well (background still there/corrupt image).
convert a.tif -clip -resize 800x600 a.png
convert a.tif -clip -alpha transparent +clip -channel A -resize 800x600 a.png
also this php code:
<?php
$image = new Imagick('a.tif');
$image->clipPath();
$image->setImageFormat('png');
$image->thumbnailImage(800, 600, true);
$image->writeImage('a.png');
here is an example tif file
Maybe somebody knows how to solve this.
EDIT:
The best result returns this:
convert test.tif -clip -alpha transparent 1.png
But it saves the background and not the clipped object. (png)