Page 1 of 1

Circular cropping seems not working on some pics

Posted: 2011-11-25T03:33:05-07:00
by emafuma
Hi all,
I'm using convert to crop an image into a circular area with trasparent background.
I'm using:
convert testCrop.jpeg -background transparent -gravity Center -crop 150.0x150.0+0+0 -resize '136.0' -vignette 1x1+2+2 circ6.png
with ImageMagick 6.7.1-0 2011-07-25 Q16

On this particular image the cropping is "inverted" as expected, on other images works fine.
Any idea?

Thanks in advance

Image
Image

Re: Circular cropping seems not working on some pics

Posted: 2011-11-25T10:43:22-07:00
by fmw42
Your image is cmyk. Try converting to rgb before doing your processing.

Re: Circular cropping seems not working on some pics

Posted: 2011-11-26T05:28:41-07:00
by emafuma
Hi, thanks a lot for replying.
Yes if I convert to RGB than the cropping is ok.
Is there a way to add this conversion to the cropping command line? (I'm doing that in an application where I don't know what kind of pictures users add)
In the conversion process, if converting an already RGB is there some possible problem?
Thanks again

Re: Circular cropping seems not working on some pics

Posted: 2011-11-26T11:30:59-07:00
by fmw42
I do not think it will change anything if you have RGB and add -colorspace RGB. Try it on a few images and see. But I will defer to the IM experts. However, converting from cmyk to rgb may give better quality if you use profiles. But then you have to find out what input profile you have. Either way, you could look in the verbose info: for the image and pick out what colorspace and/or any profiles and use that information to put in the appropriate command in your script.

Re: Circular cropping seems not working on some pics

Posted: 2011-12-15T14:50:25-07:00
by NicolasRobidoux
I think that the embedded ICC profile for this image may be broken: 3 band ICC for a 4 band CMYK.