How do I remove black background areas after using -compose CopyOpacity operation for PNG file?
Posted: 2017-04-05T02:42:34-07:00
I am trying to make an image with rounded corners and then add a shadow effect like the one below. (please right click and open image in new tab in case the images don't populate automatically below; they are being streamed from Google drive):
I used a plain jpg file which worked well since there is no transparency. However, for a png file with transparency the result shows the left over black arcs at the corners like here:
The source file I used for the above is here:
The script that I am using so far is as follows:
Can anyone please help me by suggesting how to remove those black arcs in the corners in the case of png files?
[Moderator note:
Your images don't show as images for me, and are not clickable. The URLs are:
https://drive.google.com/file/d/0B69e4- ... sp=sharing
https://drive.google.com/file/d/0B69e4- ... sp=sharing
https://drive.google.com/file/d/0B69e4- ... sp=sharing
]
I used a plain jpg file which worked well since there is no transparency. However, for a png file with transparency the result shows the left over black arcs at the corners like here:
The source file I used for the above is here:
The script that I am using so far is as follows:
Code: Select all
convert garfield.png \
\( +clone -alpha extract \
\( -size 15x15 xc:black -draw 'fill white circle 15,15 15,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 output.png
[Moderator note:
Your images don't show as images for me, and are not clickable. The URLs are:
https://drive.google.com/file/d/0B69e4- ... sp=sharing
https://drive.google.com/file/d/0B69e4- ... sp=sharing
https://drive.google.com/file/d/0B69e4- ... sp=sharing
]