# HG changeset patch # User Matti Hamalainen # Date 1540482938 -10800 # Node ID c8c698bb99b63f94d1a8288364d0a34658ec9dcf # Parent 57a2527ff63d53ba7fe28e4f56f1b316f1b44f5b Calculate number of required bitplanes more correctly. diff -r 57a2527ff63d -r c8c698bb99b6 tools/gfxconv.c --- a/tools/gfxconv.c Thu Oct 25 18:47:10 2018 +0300 +++ b/tools/gfxconv.c Thu Oct 25 18:55:38 2018 +0300 @@ -1381,9 +1381,9 @@ spec->nplanes = 0; for (int n = 8; n >= 0;) { - if (image->ncolors & (1 << n)) + if ((image->ncolors - 1) & (1 << n)) { - spec->nplanes = n; + spec->nplanes = n + 1; break; } else