imagick icon indicating copy to clipboard operation
imagick copied to clipboard

Importing clipping path to jpeg file

Open danaildinev opened this issue 2 years ago • 4 comments

Hello!

Is there a way to import clipping path from SVG into a jpeg file with Imagick? Currently, I am successfully extracting the path from 8bim with this command identify -quiet -format "%[8BIM:1999,2998:#1]" masked-image.jpg >clipping.svg, but I am wondering is there any way to "reverse" this, and is it possible?

Thank you in advance, Danail

danaildinev avatar Mar 29 '22 07:03 danaildinev

I'll be very happy if some expert resolves is it possible ... This will be very useful for my project too!

fire1 avatar Mar 29 '22 08:03 fire1

tbh, I've never seen that feature in ImageMagick.

Can you give me a runnable example? i.e. I guess I need the source images.

Danack avatar Apr 07 '22 19:04 Danack

This will copy 8bim profile for the image, the clipping path is inside in a SVG format: $ImagickTarget->setImageProfile("8bim", $fromImagick->getImageProfile("8bim")); The drawback is destroying the color profile

Sadly IM handles image profiles only as binary blobs, even they have official documentation: https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/

I'm looking forward to building such an 8bim parser, but binary is not my "thing"

fire1 avatar Apr 10 '22 11:04 fire1

just found out this: https://github.com/ImageMagick/ImageMagick/issues/55#issuecomment-157157041

Making a binary parser for 8bim will be waste of time!

fire1 avatar Apr 10 '22 12:04 fire1