Page 1 of 1

Command that will work on images that has Clipping path and is Transparent

Posted: 2018-02-14T21:09:07-07:00
by johnbasi
Hi guys,
Is there a command that works for both images that has Clipping path and Transparent images? I want to convert them to JPG file and make the background white.

This are the commands that I am using on each but would like to make a single command that works for both of them.
TRANSPARENT COMMAND

Code: Select all

convert INPUT.psd[1] -colorspace rgb -background white -flatten OUTPUT.jpg
CLIPPING PATH COMMAND

Code: Select all

convert INPUT.psd[0] -alpha transparent -clip -alpha opaque -background white -flatten OUTPUT.jpg
Files - one has clipping path the other is transparent
https://drive.google.com/file/d/1Lyiapo ... sp=sharing
https://drive.google.com/file/d/1ncdLIt ... sp=sharing

Version: ImageMagick 7.0.1-3 Q16 x64 2016-05-11

Re: Command that will work on images that has Clipping path and is Transparent

Posted: 2018-02-15T08:21:57-07:00
by snibgo
"-clip" applies to all following operations, until "+clip". You don't have "+clip" in your second command. I suggest you insert one.

In your first command, the image already has transparency. In your second command, you create transparency from the clip path. These are two different operations, which is reasonable. But I don't see how you can "make a single [convert] command that works for both of them."