Android ColorMatrix Alpha Threshold and Mask
I am trying to write some code that modifies the alpha value in every pixel in a bitmap such that if the pixels alpha is < threshold the alpha will be set to 0f. I am starting by creating a bitmap which consists of 2 circles which are drawn with a radial gradient shader, going from fully opaque to transparent. This means the edges of the 2 circles are fuzzy and transparent. I then want to have a threshold that produces an image where the fuzzy edges are “cleaned up” (i.e. there is a definitive edge to them where when the alpha goes below a threshold there is just transparency). After that, I want to finally make all the pixels that remain within this newly defined area be fully opaque (some remove the transparency from the original rendered gradient circles).