Page 1 of 1

Use the clipping path to clip? (TIF to PNG/command line)

Posted: 2014-09-17T02:39:40-07:00
by gabw
Hi,

I want to convert an TIF with multiple paths to an transparent png. That works great if there is only one path in the TIF file.
But sometimes I have some tif files that have more than one path and than the "right" path to clip is marked as clipping path (can be seen in Photoshop as the bold one, screenshot below).

My command selects always the first path found in the tif file, clips it and saves it to a transparent png.

Code: Select all

convert input.tif -alpha transparent -clip -alpha opaque -resize 800x600 final.png
So how can I adjust this command to select the clipping path?

TIF File Download: http://gab3.de/share/tif_file_paths.zip

Photoshop:
Image

Result of my command: http://i.imgur.com/ho726fw.png (ImageMagick selected here "Pfad 2" instead of the marked clipping path "Pfad 4")
Wanted Result: http://i.imgur.com/G0dMvuH.png (made manually with Ps)

Re: Use the clipping path to clip? (TIF to PNG/command line)

Posted: 2014-09-17T06:41:51-07:00
by snibgo

Code: Select all

convert Fanta_Orange_05L_MW_PET_Kasten.tif -alpha transparent -clip -alpha opaque -resize 800x600 x.png
See http://imagemagick.org/script/command-l ... #clip-path

Re: Use the clipping path to clip? (TIF to PNG/command line)

Posted: 2014-09-30T02:09:15-07:00
by gabw
And how can I automatically use the marked path without naming it? Or is there a way to get the name of the marked path?

Cause I need it to this this automatically on more than 10000 files...

Re: Use the clipping path to clip? (TIF to PNG/command line)

Posted: 2014-09-30T03:43:31-07:00
by snibgo

Code: Select all

F:\web\im>exiftool -s3 -ClippingPathName Fanta_Orange_05L_MW_PET_Kasten.tif
Pfad 4
Does that answer the question?

Re: Use the clipping path to clip? (TIF to PNG/command line)

Posted: 2014-10-02T05:39:05-07:00
by gabw
Thank you very much - that helped a lot.