I'd like to remove all of the black from a picture attached to a sprite so that it becomes transparent.
Asked
Active
Viewed 1,005 times
2 Answers
2
I'll copy and paste in case that link dies:
" I used a 'Color Matrix' patch, setting 'Alpha Vector (W)' and 'Bias Vector(X,Y,Z)' to 1 and all other to 0. You will then find the alpha channel from the input image at the output."
I found this before, but I can't figure out exactly how to do it.
I found another solution using core image filter:
kernel vec4 darkToTransparent(sampler image)
{
vec4 color = sample(image, samplerCoord(image));
color.a = (color.r+color.g+color.b) > 0.005 ? 1.0:0.;
return color;
}

Quinn Taylor
- 44,553
- 16
- 113
- 131

thescreamingdrills
- 81
- 4
- 7