From 8a5eebf4091699001160a0802df39962c4d37663 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 May 2016 09:30:36 +0530 Subject: [PATCH] ... --- src/calibre/utils/imageops/quantize.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/utils/imageops/quantize.cpp b/src/calibre/utils/imageops/quantize.cpp index 5a30fb389e..fd571ef313 100644 --- a/src/calibre/utils/imageops/quantize.cpp +++ b/src/calibre/utils/imageops/quantize.cpp @@ -3,7 +3,8 @@ * Copyright (C) 2016 Kovid Goyal * * octree based image quantization. - * Based on https://www.microsoft.com/msj/archive/S3F1.aspx + * See https://www.microsoft.com/msj/archive/S3F1.aspx for a simple to follow + * writeup on this algorithm * * Distributed under terms of the GPL3 license. */ @@ -212,6 +213,7 @@ public: }; +// Image Dithering {{{ static inline void propagate_error(QVector &error_line, int c, unsigned char mult, DoublePixel &error) { error_line[c].red += error.red * mult; error_line[c].green += error.green * mult; @@ -263,6 +265,7 @@ static void dither_image(const QImage &img, QImage &ans, QVector &color_ta } } } +// }}} QImage quantize(const QImage &image, unsigned int maximum_colors, bool dither) { ScopedGILRelease PyGILRelease;