Circular cropping seems not working on some pics

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
emafuma
Posts: 9
Joined: 2011-07-15T05:45:37-07:00
Authentication code: 8675308

Circular cropping seems not working on some pics

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Circular cropping seems not working on some pics

Post by fmw42 »

Your image is cmyk. Try converting to rgb before doing your processing.
emafuma
Posts: 9
Joined: 2011-07-15T05:45:37-07:00
Authentication code: 8675308

Re: Circular cropping seems not working on some pics

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Circular cropping seems not working on some pics

Post 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.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Circular cropping seems not working on some pics

Post by NicolasRobidoux »

I think that the embedded ICC profile for this image may be broken: 3 band ICC for a 4 band CMYK.
Post Reply