We have a PHP tool which converts images from PSD into other formats by calling ImageMagick.
In order to potentially extend the tool's functionality, I now need to find out "what are the possibilities of ImageMagick to convert PSD files into GIF, PNG, and JPG files in respect to clipping paths", e.g. answering the following questions:
can ImageMagick convert PSD files into GIF/JPG/PNG and maintain the clipping path so that it can be further edited later?
or can ImageMagick only convert PSD files into GIF/JPG/PNG and therefore converting everything outside the clipping path into a transparent area?
do each of the formats GIF, PNG, and JPG even support clipping paths in the sense that PSD files support them?
I do not have a psd file with a clip path - out of interest could you provide me with one I can use on my imagemagick example site? I have a jpg with a clip path but am not alowed to use it on my site.
Anyway I started with a jpg that I am told has a clip path and ran this code:
exec(" convert clip_path.jpg -clip -negate clipped1.jpg");
exec(" convert clip_path.jpg -resize x300 -clip -negate clipped2.jpg");
exec(" convert clip_path.jpg clipped3.png");
exec(" convert clipped3.png -clip -negate clipped4.jpg");
The results were:
1/ Inverted colours within the clip path - so clip path is working.
2/ Resized and inverted colours within the clip path - so clip path is retained on resize.
3/ Changed to a png ready for the clip test in 4/
4/ Inverted colours within the clip path - clip path is retaind when changing format.
The clip options are listed here http://www.imagemagick.org/script/command-line-options.php#clip and some examples and more notes here http://www.imagemagick.org/Usage/masking/#clip_mask