mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-04-24 09:59:34 -04:00
Double the threshold of image area coverage for a fallback dominant color
This commit is contained in:
parent
e41a94d45b
commit
dd675f96d5
@ -3,7 +3,7 @@
|
||||
# Copyright: Andy C <achuongdev@gmail.com>, un_pogaz <un.pogaz@gmail.com>, Kovid Goyal <kovid@kovidgoyal.net>
|
||||
|
||||
# TODO:
|
||||
# Remove py_dominant_color after beta release
|
||||
# Remove python contrast_ratio after beta release
|
||||
|
||||
# Imports {{{
|
||||
import bisect
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user