Page 1 of 1

[Solved] Remove cutout residue (transparent background picture)

Posted: 2018-11-06T13:32:27-07:00
by Rye
So, as so often, when someone uses any app to remove the background (mostly with the magic wand tool), you might end up with this:

Image

As it is plain to see:
Around the contours, there is a white "residue", that couldn't be removed with the programs tool.

Question:

Can imagemagick help here ?
(I heard about a -trim option, but that only seems to be appropriate if the background is entirely colored ?)

- Thanks in advance.

Re: Remove cutout residue (transparent background picture)

Posted: 2018-11-06T17:39:38-07:00
by fmw42
try a little anti-aliasing of the alpha channel as follows:

Code: Select all

convert image.png -channel a -blur 0x1 -level 50x100% +channel result.png
Adjust the blur x1 value as desired.

Re: Remove cutout residue (transparent background picture)

Posted: 2018-11-07T09:03:32-07:00
by Rye
Works perfectly !

The blur variable changes the way the edges are smoothed ?

Re: Remove cutout residue (transparent background picture)

Posted: 2018-11-07T10:04:21-07:00
by fmw42
Rye wrote: 2018-11-07T09:03:32-07:00 The blur variable changes the way the edges are smoothed ?
Yes, larger blur value than 1 (0x1) will smooth more and you will lose more edge data. You probably can reduce the 1 to 0.5 as about the minimum that you can detect. But it may be too small to make a change. Try different values and see what looks best to you.