Skip to content

how make all single color pixels with fuzz which partial transparent to transparent or not transparent? #6908

Answered by snibgo
markonop93 asked this question in Help
Discussion options

You must be logged in to vote

fmw42's solution won't work because -fx is not sensitive to -fuzz, and because u.a==0 doesn't set u.a to zero, it merely tests whether u.a is zero. Instead, I suggest:

magick image.png -channel A -fx "(u.a<1 && abs(u.r-1)<0.2 && abs(u.g-0.427)<0.2 && abs(u.b-0.176)<0.2) ? 0 : u.a" +channel result.png

Note that this processes only the alpha channel.

This is difficult to test without an example image. @markonop93, please supply an example input.

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@markonop93
Comment options

@fmw42
Comment options

@fmw42
Comment options

Comment options

You must be logged in to vote
1 reply
@markonop93
Comment options

Answer selected by markonop93
Comment options

You must be logged in to vote
1 reply
@markonop93
Comment options

Comment options

You must be logged in to vote
1 reply
@markonop93
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants