Page 1 of 1

Composite potrace output into jpg clipping paths

Posted: 2013-12-17T01:01:24-07:00
by msundell
First, thanks for ImageMagick - it's really a great peace of software!

Anyway, I'm currently testing potrace to generate a vector representations of an alpha channel. Is it possible to use ImageMagick to composite clipping paths into an output file based on input from a TIFF or PNG + EPS, PS, PDF or SVG?

RGBA TIFF or PNG => potrace alpha channel gives vectors => vector as clipping path + RGB TIFF or PNG => JPG incl. clipping paths.

Tried to search the forums without success,

Mikael

Re: Composite potrace output into jpg clipping paths

Posted: 2013-12-17T01:19:22-07:00
by snibgo
If I understand what you want, yes.

With potrace you can create an SVG which is a white object on a black backround. Then a command like this ...

Code: Select all

convert background.png object.png mask.svg -composite out.png
... will show background.png where the mask is black and object.png where the mask is white.

If this isn't what you want, perhaps you can supply sample images. Put them somewhere like dropbox.com and paste the URLs here.

Re: Composite potrace output into jpg clipping paths

Posted: 2013-12-17T02:08:24-07:00
by msundell
Not sure if this is exactly what I want :-)
The SVG contains a vector representation of the mask (clipping paths), a trace from the alpha of the original image.
The SVG clipping paths needs to be inserted as the clipping paths for the result jpg. Is that what happens if you change the result of the composite format to jpg instead of png?
Thanks,
Mikael

Re: Composite potrace output into jpg clipping paths

Posted: 2013-12-17T02:22:30-07:00
by snibgo
If you want the SVG embedded in the JPG as a vector clipping path, then IM won't do that. Exiftool might.

Re: Composite potrace output into jpg clipping paths

Posted: 2013-12-17T02:29:00-07:00
by msundell
Will give GIMP a try, playing around with Script-Fu now.
Mikael