Technology EFX TV
Technology EFX TV

Reputation: 21

I want to remove the white background from and image not inside just outside the colored pixels using convert command in terminal

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.

Upvotes: 2

Views: 850

Answers (2)

fileyfood500
fileyfood500

Reputation: 1331

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

Upvotes: 2

fmw42
fmw42

Reputation: 53154

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

Upvotes: 4

Related Questions