From 9e9abfab27b7736399bb934862326cd53a77ec19 Mon Sep 17 00:00:00 2001 From: David Thomas Date: Thu, 12 Jun 2025 15:25:20 +0100 Subject: [PATCH 01/11] Add five new types of diffusion dither and expose zig zag to user This extends the existing dithering code to add Jarvis-Judice-Ninke, Stucki, Atkinson, Burkes and Sierra error diffused dithers. It also exposes the zig zag (serpentine) choice to the user. Diffusion is tweaked to use fixed point for the error values. --- data/pref.xml | 1 + data/strings/en.ini | 13 +- src/app/cli/cli_processor.cpp | 16 +- src/app/commands/cmd_change_pixel_format.cpp | 62 ++++-- src/app/commands/new_params.cpp | 15 +- src/app/ui/context_bar.cpp | 22 ++- src/app/ui/dithering_selector.cpp | 17 +- src/render/dithering.h | 5 + src/render/dithering_algorithm.h | 17 +- src/render/error_diffusion.cpp | 190 ++++++++++++++++--- src/render/error_diffusion.h | 38 +++- src/render/ordered_dither.cpp | 4 +- src/render/ordered_dither.h | 1 - src/render/quantization.cpp | 25 ++- src/render/quantization.h | 2 +- 15 files changed, 364 insertions(+), 64 deletions(-) diff --git a/data/pref.xml b/data/pref.xml index 9c852c067..831728b4c 100644 --- a/data/pref.xml +++ b/data/pref.xml @@ -329,6 +329,7 @@