0

For our website, we clip images based on a clipping path. Since this needs to be done daily, for a lot of images, we have set up a server on which we run ImageMagick.

I noticed that clipped images have a small black border around the product, where the original clipping path was.

When simulating clipping in Photoshop, there is no line visible. Any clues?

Clipped with ImageMagic Clipped with Photoshop

For anyone interested, here is the original image: https://media.hanos.nl/transfer/1adc93c00c808b346a13f4e03ac3b793f6be6c53c3d1493adfb072e09ef35426

Thank you in advance for helping me out!

Regards!

I'm not that well versed in ImageMagick, I'm curious what goes wrong.

wd3003
  • 1
  • 1

1 Answers1

1

Looks like Imagemagick 6 has a little issue there. However it does not show in Imagemagick 7. Nevertheless, you can anti-alias that away in Imagemagick 6. I am using Imagemagick 6.9.12-82 and 7.1.1-5

IM 6:

convert -quiet 61270542.jpg -alpha transparent -clip -alpha opaque -strip 61270542_clipped1_6.jpg

enter image description here

IM 7:

magick -quiet 61270542.jpg -alpha transparent -clip -alpha opaque -strip 61270542_clipped1_7.jpg

enter image description here

IM 6 antialiased:

identify -quiet -format "%[8BIM:1999,2998:#1]" 61270542.jpg |
convert -quiet 61270542.jpg +repage
( - -negate -blur 0x5 -level 50x100% +channel )
-alpha off -compose copy_opacity -composite
61270542_clipped2_6.jpg

enter image description here

IM 7 anti-aliased:

magick identify -quiet -format "%[8BIM:1999,2998:#1]" 61270542.jpg |
magick -quiet 61270542.jpg +repage
( - -channel rgb -negate -blur 0x5 -level 50x100% +channel )
-alpha off -compose copy_opacity -composite
61270542_clipped2_7.jpg

enter image description here

fmw42
  • 46,825
  • 10
  • 62
  • 80