From dd675f96d5b49edf12a187d50ce89ecbfe71afd0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 4 Jan 2026 21:41:06 +0530 Subject: [PATCH] Double the threshold of image area coverage for a fallback dominant color --- src/calibre/gui2/library/bookshelf_view.py | 2 +- src/calibre/utils/imageops/imageops.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/library/bookshelf_view.py b/src/calibre/gui2/library/bookshelf_view.py index 5f24e65902..ef74bfeb74 100644 --- a/src/calibre/gui2/library/bookshelf_view.py +++ b/src/calibre/gui2/library/bookshelf_view.py @@ -3,7 +3,7 @@ # Copyright: Andy C , un_pogaz , Kovid Goyal # TODO: -# Remove py_dominant_color after beta release +# Remove python contrast_ratio after beta release # Imports {{{ import bisect diff --git a/src/calibre/utils/imageops/imageops.cpp b/src/calibre/utils/imageops/imageops.cpp index 556ef5b254..7d11ac7a11 100644 --- a/src/calibre/utils/imageops/imageops.cpp +++ b/src/calibre/utils/imageops/imageops.cpp @@ -679,7 +679,7 @@ QColor dominant_color(const QImage &image) { // {{{ float saturation = QColor(ans).saturationF(); // Look for more vibrant alternative if needed if (saturation < 0.2 && sortedColors.size() > 1) { - const int min_num_pixels = (int)(0.05 * width * height); + const int min_num_pixels = (int)(0.1 * width * height); for (qsizetype i = 1; i < limit; i++) { float q = QColor(sortedColors[i].color).saturationF(); if (q > 0.3 && sortedColors[i].count > min_num_pixels) {