Page 1 of 1

Clipping paths on Linux

Posted: 2008-06-13T00:41:21-07:00
by Brian P
I have a lot of images with clipping paths, and I need all the backgrounds to be white.

Here is what I think the command should look like:

Code: Select all

convert +clip-path #1 -fill white -draw "color 0,0 reset" in.jpg out.jpg
- and that works as it should on a windows machine. When I try it on linux, it won't accept it as a valid convert command. It just shows the help page.

What am I doing wrong?

Any help is much appreciated.

Re: Clipping paths on Linux

Posted: 2008-06-14T15:11:29-07:00
by rmagick
The # is the comment character in bash, so you must escape it or surround it with apostrophes:

Code: Select all

convert +clip-path \#1 -fill white -draw "color 0,0 reset" in.jpg out.jpg
convert +clip-path '#1' -fill white -draw "color 0,0 reset" in.jpg out.jpg

Re: Clipping paths on Linux

Posted: 2008-06-16T01:49:55-07:00
by Brian P
It worked - thank you very much.

I guess I have been staring for too long at the command so I missed the obvious error.