bitmap2component: Fix logic for alpha mask

For POTRACE, black is the foreground and white is the background.  We
should keep the convention by requiring the pixin to be less than the
black threshhold as well as the alpha to be at least the alpha
threshhold.

Fixes: lp:1821563
* https://bugs.launchpad.net/kicad/+bug/1821563

(cherry picked from commit f1704fd61a)
This commit is contained in:
Seth Hillbrand 2019-06-08 12:01:24 -07:00
parent 81c5ba257b
commit 35da498a32
1 changed files with 1 additions and 1 deletions

View File

@ -461,7 +461,7 @@ void BM2CMP_FRAME::Binarize( double aThreshold )
auto alpha = m_Greyscale_Image.HasAlpha() ?
m_Greyscale_Image.GetAlpha( x, y ) : wxALPHA_OPAQUE;
if( pixin < threshold || alpha < alpha_thresh )
if( pixin < threshold && alpha > alpha_thresh )
pixout = 0;
else
pixout = 255;