Composite potrace output into jpg clipping paths

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
msundell
Posts: 13
Joined: 2013-12-17T00:53:52-07:00
Authentication code: 6789

Composite potrace output into jpg clipping paths

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Composite potrace output into jpg clipping paths

Post 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.
snibgo's IM pages: im.snibgo.com
msundell
Posts: 13
Joined: 2013-12-17T00:53:52-07:00
Authentication code: 6789

Re: Composite potrace output into jpg clipping paths

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Composite potrace output into jpg clipping paths

Post by snibgo »

If you want the SVG embedded in the JPG as a vector clipping path, then IM won't do that. Exiftool might.
snibgo's IM pages: im.snibgo.com
msundell
Posts: 13
Joined: 2013-12-17T00:53:52-07:00
Authentication code: 6789

Re: Composite potrace output into jpg clipping paths

Post by msundell »

Will give GIMP a try, playing around with Script-Fu now.
Mikael
Post Reply