PDA

View Full Version : QImage convertToFormat dithering issue



oPryzeLP
13th February 2016, 20:09
Hello,
In my project I need to convert an image to one that is made up of a max of 144 predetermined colors. I created a colorTable with all 144 QRgb values. However upon converting the format, dithering isn't working if I specify a colorTable.


convImage = sourceImage.convertToFormat(QImage::Format_Indexed 8, colorTable, Qt::DiffuseDither);

The resulting image is the exact same as if I were to use ThresholdDither. If I run the same function without specifying a colorTable, dithering works perfectly.

EDIT: I now see in the docs that dithering is disabled for indexed images. I reallllly need a workaround then. Any ideas?