[magick-users] Can't get clip to work
micha
micha.gellner at lycos.de
Tue Jan 8 04:23:54 PST 2008
Hi,
some more infos.
This call does seem to do almost what I need:
convert rgb.TIF -fill white -draw "color 0 0 reset" -transparent white
-clip -draw "Image COpy 0,0 0,0 rgb.TIF" transparent.png
However if I understand this correctly then this would mean I cannot use
any white areas in my image, correct? Would there be any other way of
removing everything outside the clipping path without using up a color
(that might already be used within the clipping path)? Or is that not a
problem anyways if colors within the clipping path are not touched?
Also another thing I noticed - doing the same operation in Photoshop
(create selection from clipping path, inverting selection, deleting the
selection) gives a slightly different result. It seems that PS removes
about one more pixel (maybe everything that is outside and directly
under the clipping path?). Also it seems to smoothen the clipping path
(or using some kind of antialiasing) so the corners of the new image
look much smoother. Is something like that possible with IM as well? I
tried using -antialias but without any luck.
michael
micha schrieb:
> Hi,
>
> I looked in the archive to find previous posts about this but all other
> posts did not help me.
>
> Ok, here is the problem - I'm simply trying to to clip a jpeg image and
> convert it to PNG (making the clipped areas transparent).
>
> I tried
> convert image.jpg -clip image.png
> convert -clip image.jpg image.png
>
> The image gets converted however nothing is clipped - no error message
> given. When using -debug all I can see that a lot of SVG stuff is done
> (which isn't when omitting -clip).
>
> I also tried using clip-path - using the actual clipping path name
> returns the same result as above but given a bogus name returns an
> error. So it seems that the clipping path is actually found and that
> something is done with it but it is not applied to the output image.
>
> I also tried
> convert image.jpg -clip -fill #000 image.png
> convert -clip -fill #000 image.jpg image.png
>
> Again the image gets converted but nothing changed.
>
> I tested with ImageMagick-6.2.6-Q16 (dynamic dlls) and
> ImageMagick-6.3.7-Q16 (static).
>
> In the documenatation it says that -clip does need the xml library -
> however there is no information if that only applies to linux, windows
> or both and where to get that library and how to install it.
> Just guessing I got the lib2.xml from here
> http://www.zlatkovic.com/libxml.en.html (libxml for Gnome, WIndows
> binaries). I placed it into the current folder and the Imagemagick
> folder. Not sure what else to try - how do I know if the xml library is
> being used or if ImageMagick still thinks it's missing?
>
> So what am I doing wrong?
>
> Some more notes:
> In Photoshop the path is shown correctly. Saving the input image as TIF
> or EPS did not produce any different results.
> I also created a new image in PS CS3 just converting a selection into a
> clipping path and saving that as JPG but I get the same results.
>
> Any help would be appreciated.
>
> Thanks,
> michael
> _______________________________________________
> Magick-users mailing list
> Magick-users at imagemagick.org
> http://studio.imagemagick.org/mailman/listinfo/magick-users
>
>
More information about the Magick-users
mailing list