skip to Main Content

I’ve image an image with white background. I used command to make it transparent

convert imoji.png -fuzz 20% -transparent white result.png

I got the result.png. The command has removed pixels inside the emoji and some other parts. I need it to be something like this. I made it using photoshop by reducing the tolerance of the magic wand tool. Help me to do the same using the convert command in the terminal. I reduced the -fuzz 20 to 1% still not getting the result.

2

Answers


  1. Use flood fill from the top left corner of the image in ImageMagick.

    convert imoji.png -fuzz 20% -fill none -draw "matte 0,0 floodfill" result.png
    

    enter image description here

    Login or Signup to reply.
  2. In the updated ImageMagick 7.1.1-20 version, matte is no longer supported as a command. Instead, use alpha:

    convert imoji.png -fuzz 20% -fill none -draw "alpha 0,0 floodfill" result.png
    

    You can install ImageMagick as follows:

    Mac

    brew install imagemagick
    

    Ubuntu linux

    sudo apt-get install imagemagick
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search