HaikuArchives / ArtPaint

ArtPaint is a painting and image processing program.
https://haikuarchives.github.io/ArtPaint/
29 stars 18 forks source link

BitmapUtilities: make ConvertToMask only output exactly 1 or 0 alpha #480

Closed dsizzle closed 1 year ago

dsizzle commented 1 year ago

This fixes #479, but this change should be reverted when #363 is fixed.

I figured it out. It's not a bug, it's a feature! The "select all non-transparent" uses the layer alpha to cut out the pieces that are transparent. In my case here, the circle is not fully opaque, and so the resulting selection map is not fully opaque. We decide if something is selected or not based on whether it's exactly 0 or not.

we need #363 to handle this properly and so for now/this release it's safest to just make "select all non-transparent" just take any non-opaque pixel.

humdingerb commented 1 year ago

Ah, I didn't try with not fully opaque objects when I tried to reproduce earlier. Now I tried and can confirm that this change fixes it. Congrats!