transparency - ImageMagick: How to make both black and white transparent? -


converting black , dark shades transparent works fine imagemagick. managed perform crop , resize in same line.

convert input.png -background none -fuzz 45% -transparent black -flatten -crop 640x480+12+9 -resize 105% output.png 

however, input image contains number of white lines, convert transparent in output.

how go that? possible within same command line?

sure, add second -transparent.

convert -size 512x512 gradient:black-white a.png    # create initial black-to-white gradient 

enter image description here

convert -fuzz 20% a.png -transparent black -transparent white result.png  # lose 20% off black end , white end 

enter image description here

or, fuzz...

convert -fuzz 40% a.png -transparent black -transparent white result.png 

enter image description here


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -