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:
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.
[Solved] Remove cutout residue (transparent background picture)
[Solved] Remove cutout residue (transparent background picture)
Last edited by Rye on 2018-11-07T09:58:04-07:00, edited 1 time in total.
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Remove cutout residue (transparent background picture)
try a little anti-aliasing of the alpha channel as follows:
Adjust the blur x1 value as desired.
Code: Select all
convert image.png -channel a -blur 0x1 -level 50x100% +channel result.png
Re: Remove cutout residue (transparent background picture)
Works perfectly !
The blur variable changes the way the edges are smoothed ?
The blur variable changes the way the edges are smoothed ?
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Remove cutout residue (transparent background picture)
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.