Page 1 of 1

Anti-aliased clipping path

Posted: 2016-10-20T06:53:30-07:00
by jansuhr
I'm working on a project that will receive hundreds of images with a clipping path. Each image will be saved in one version as a JPG with a white background and as a PSD with transparent background.

When using IM to clip the image I get a very jagged result where the clipping path is, very much like when you not using anti-aliased in Photoshop.

I haven't found any option to "-clip" with an anti-aliased option and after some searching I found a workaround that blurs the mask created from the -clip option. However the result doing this approach is not satisfying, you still see the jagginess but a little blurred.

The left one is made in IM the right one from Photoshop

Image


Is there anyway to get this better with IM?


Thanks

Jan

Re: Anti-aliased clipping path

Posted: 2016-10-20T09:11:41-07:00
by snibgo
A better way is probably to extract the clip path as SVG, and rasterize that. See for example viewtopic.php?f=1&t=29674&p=133783

Re: Anti-aliased clipping path

Posted: 2016-10-20T09:58:46-07:00
by jansuhr
I did as the example in the post and it got a little better but there is still more jaggines than with Photoshop.

This is the syntax I used

Code: Select all

identify -quiet -format "%[8BIM:1999,2998:#1]" input.jpg  | convert -quiet input.jpg ( - -negate ) -alpha off -compose copy_opacity -composite output.psd
There is a mention of +dither in one of the comments, where in the syntax should that be added?


Thanks


Jan

Re: Anti-aliased clipping path

Posted: 2016-10-20T10:25:06-07:00
by snibgo
I can't see that "+dither" would have any effect.