Skip to content

Instantly share code, notes, and snippets.

@rynop
Last active November 6, 2019 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rynop/f8fce887780e5ac1d05a4027922fc74d to your computer and use it in GitHub Desktop.
Save rynop/f8fce887780e5ac1d05a4027922fc74d to your computer and use it in GitHub Desktop.
error
$ magick front.jpg -fuzz 2% -fill none -draw "matte 0,0 floodfill" -channel alpha -blur 0x2 -level 50x100% +channel front.png
magick: non-conforming drawing primitive definition `0' @ error/draw.c/RenderMVGContent/4406.
$ magick --version
Version: ImageMagick 7.0.8-68 Q16 x86_64 2019-10-07 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(3.1)
Delegates (built-in): bzlib freetype heic jng jp2 jpeg lcms ltdl lzma openexr png tiff webp xml zlib
//The following works, but the edges are really bad (floating white pixels around border):
$ convert front.jpg -fuzz 2% -fill none -channel alpha -blur 0x2 -level 50x100% +channel -transparent "#ffffff" out.png
@fmw42
Copy link

fmw42 commented Nov 6, 2019

try:

magick img.png -fuzz 2% -fill none -draw "alpha 0,0 floodfill" -channel alpha -blur 0x2 -level 50x100% +channel result.png

There are a few differences between IM 6 and IM 7.

If the edges are still jagged, then you may need to increase the fuzz value or increase the blur. Perhaps post your image and I take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment