Clipping paths on Linux

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Brian P

Clipping paths on Linux

Post 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.
rmagick
Posts: 245
Joined: 2006-03-16T17:30:48-07:00
Location: Durham, NC, USA

Re: Clipping paths on Linux

Post 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
Brian P

Re: Clipping paths on Linux

Post 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.
Post Reply