Search code examples
imagemagickimagemagick-convert

Imagemagick Cannot remove black around corners


This is the initial image:

enter image description here

I wanted to severely round the corners of an image without having jagged edges but i can't remove the black around them.

convert image.jpg '(' +clone -crop 64x64+0+0 -fill white -colorize 100% -draw 'fill black circle 60,60 60,0' -background transparent -alpha shape '(' +clone -flip ')' '(' +clone -flop ')' '(' +clone -flip ')' ')' -flatten image.png;

Anyone has an ideea? I tried -background transparent and other stuff and it's not working.

enter image description here

The result i want is the image to have severely rounded corners without the black around them.


Solution

  • I managed to fix it.

    Used: convert image.jpg '(' +clone -alpha extract '(' -size 100x100 xc:black -draw 'fill white circle 100,100 100,0' -write mpr:arc +delete ')' '(' mpr:arc ')' -gravity northwest -composite '(' mpr:arc -flip ')' -gravity southwest -composite '(' mpr:arc -flop ')' -gravity northeast -composite '(' mpr:arc -rotate 180 ')' -gravity southeast -composite ')' -alpha off -compose CopyOpacity -composite -compose over '(' +clone -background black -shadow 80x3+5+5 ')' +swap -background none -layers merge -rotate 1 image.png;

    Now it looks like this enter image description here