Page 1 of 1

Clipping path doesn't follows the images size

Posted: 2013-09-20T05:55:24-07:00
by eduardo.melgar
Original file (cmyk_8bits_path.tif):https://docs.google.com/file/d/0B8WNVy3 ... edit?pli=1
Result file (test.tif):https://docs.google.com/file/d/0B8WNVy3 ... sp=sharing
Photoshop Screenshot (photoshop_screenshot.pdf):https://docs.google.com/file/d/0B8WNVy3 ... sp=sharing

The command I run is:
convert cmyk_8bits_path.tif -flatten -alpha transparent -clip -alpha opaque -trim +repage test.tif
What I am trying to do here is:
- Flatten the image to get only one layer (-flatten)
- Get rid of the background (-alpha transparent -clip -alpha opaque)
- Trim the page based on transparent pixels (-trim +repage)
As you can see the clipping-path is around the original product image (file: cmyk_8bits_path.tif) and after running the commands the image is transparent and is trimmed but the path size is different: it looks like the size is reduced together with the size of the canvas (I am not changing the image size, only the canvas size when trimming)

I run IM on a Ubuntu 13.04 box with the default IM installation:
Version: ImageMagick 6.7.7-10 2013-09-10 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC

Re: Clipping path doesn't follows the images size

Posted: 2013-09-20T07:25:26-07:00
by snibgo
It is good practice to turn off clipping when you have finished with it.

Code: Select all

convert cmyk_8bits_path.tif -flatten -alpha transparent -clip -alpha opaque +clip -trim +repage test.tif
However, this doesn't solve the problem. By a process of elimination, there seems to be a bug that "-trim" shrinks the path, as if it was resized. We can see where the path is by:

Code: Select all

%IM%convert test.tif -clip -negate +clip t.tif
A simpler command also shrinks the clip path, but not so much:

Code: Select all

%IM%convert cmyk_8bits_path.tif -trim test2.tif
(Tested with 6.8.6-9 in Windows 7.)

Perhaps my understanding of "-trim" and clip paths is wrong, or a developer would need to comment.

Re: Clipping path doesn't follows the images size

Posted: 2013-09-24T00:30:52-07:00
by eduardo.melgar
Hi,
Anybody knows how to get this issue reviewed by a developer?

Re: Clipping path doesn't follows the images size

Posted: 2013-09-24T03:27:00-07:00
by dlemstra
Can you fix the link to your "Result file (test.tif)" image? Its the same file as the original file.

Re: Clipping path doesn't follows the images size

Posted: 2013-09-24T13:57:50-07:00
by eduardo.melgar
Sorry about the link. It is fixed now.