app: do not snap white/black when making 2 color palette

For such needs there is a dedicated 1bit black/white palette in the
dialog.
This commit is contained in:
Øyvind Kolås
2020-05-01 17:35:50 +02:00
parent 85d9730936
commit 80664c8e6e

View File

@ -2816,13 +2816,17 @@ snap_to_black_and_white (QuantizeObj *quantobj)
}
}
if (had_white && white_dist < POW2(32))
if (desired > 2 &&
had_white &&
white_dist < POW2(128))
{
quantobj->cmap[whitest].red =
quantobj->cmap[whitest].green =
quantobj->cmap[whitest].blue = 255;
}
if (had_black && black_dist < POW2(32))
if (desired > 2 &&
had_black &&
black_dist < POW2(128))
{
quantobj->cmap[blackest].red =
quantobj->cmap[blackest].green =