Page 1 of 1
Insert clipping path
Posted: 2015-10-30T03:01:25-07:00
by loic.rapp
Hello,
Sorry, but I don't know exactly where I supposed to post my message.
I need to do something with ImageMagick: I have an empty image (JPEG) who contains an Photoshop clipping path.
With a
I can get the SVG clipping path code of my image (JPEG).
But now, I want to insert this clipping path into an other image (also a JPEG) who have no clipping path.
It is possible to do that with ImageMagick or not? If it's possible, how can I do that. I can show you an example if someone need it.
Have a good day!
Re: Insert clipping path
Posted: 2015-10-30T13:56:23-07:00
by fmw42
IM can extract the clip path as an SVG (text) file. See
http://www.imagemagick.org/Usage/masking/#clip_mask. But I do not think it can be transferred to another file. You can save the SVG clip path as an SVG file and then use it as a mask to apply to another file. See
http://www.imagemagick.org/Usage/masking/#read_mask
Re: Insert clipping path
Posted: 2015-11-02T01:40:38-07:00
by loic.rapp
I already get an SVG clipping path, with a script who works with identify -verbose.
But, I don't really understand the read mask part..
Re: Insert clipping path
Posted: 2015-11-02T11:06:21-07:00
by fmw42
I do not understand what exactly you are trying to do. Please explain in more detail. A clipping path from one image may not work for any other image. What do you want to do with the clipping path on the second image? Can you post your image that has the clipping path and the one you want to transfer it to and explain then how you want to use the clipping path on the second image? Is it to mask out some part of the second image?
Re: Insert clipping path
Posted: 2015-11-27T01:45:53-07:00
by loic.rapp
I need to extract a clipping path from one image (as SVG for example), and I need to reimport it to an other one.
So, I have a low quality JPEG file with a Photoshop Clipping Path, with a
Code: Select all
identify -verbose /path/of/myimage.jpg
I get the clipping path and I use "cut, grep and awk" to create a ready-to-use SVG file.
So for now, I have:
- One low quality JPEG
- One SVG file who is the low quality JPEG clipping path
- One high quality JPEG
How can I import the clipping path of the low quality JPEG to the high quality JPEG file? With the SVG or directly the low quality JPEG.
Re: Insert clipping path
Posted: 2015-12-07T02:40:40-07:00
by loic.rapp
UP!
Re: Insert clipping path
Posted: 2015-12-21T15:36:11-07:00
by loic.rapp
UP!
Re: Insert clipping path
Posted: 2015-12-21T16:05:43-07:00
by fmw42
I am not an expert on clip paths. But I do not think IM can import clip paths from svg. As far as I know, it only exports clip paths.
Even if it could, the low res one would not work with the high res one. The clip path would not match on the high res one. You can apply the clip path as a mask, but I do not think it would match the high resolution image.
Re: Insert clipping path
Posted: 2019-06-14T14:37:43-07:00
by promonda
I am using Magick.NET to process image in C#. I want to embed/add a clipping path taken from a SVG file to my target image. The clipping path dimension and target image dimension is exactly same. I want it to be embedded into target image so that we can change the background outside of clipping path.
There is two method for Clipping path functionality in Magick.NET GetClippingPath() and SetClippingPath(). While GetClippingPath() works well for images having clipping path embedded, SetClippingPath() doesn't work at all.
Is it really possible to set clip path using Magick.NET, if so how I can achieve this.. Please help. I have a deadline to answer if it can be done or not.
Re: Insert clipping path
Posted: 2019-06-14T15:56:45-07:00
by fmw42
Code: Select all
I am not an expert on clip paths. But I do not think IM can import clip paths from svg. As far as I know, it only exports clip paths.
Re: Insert clipping path
Posted: 2019-06-18T07:49:47-07:00
by promonda
Is it possible to add clipping path (from SVG) using ImageMagick command line or ImageMagick command also doesn't support it.
Re: Insert clipping path
Posted: 2019-06-18T08:24:57-07:00
by fmw42
NO! ImageMagick cannot do that. Did you read the post above?
Re: Insert clipping path
Posted: 2019-06-18T08:42:49-07:00
by promonda
Ok. I read the above post, just checked if there is any new version that support this as the earlier post is quite older. Thanks for your reply.
Re: Insert clipping path
Posted: 2019-06-18T09:41:04-07:00
by fmw42
Sorry, no updates and no plans for that as far as I know.