Color - quantization dithering - add algorithms, unify options

Ideas for improvements and requests for new features in XnView MP

Moderator: xnview

User avatar
user0
XnThusiast
Posts: 2996
Joined: Sat May 09, 2015 9:37 am

Color - quantization dithering - add algorithms, unify options

Post by user0 »

XnViewMP 1.7.1
Windows11 (23H2), display resolution 3840x2160, dpi scale 150%


Color depth - quantization and dithering
Dithering options are different for Grayscale and Indexed colors in 'Change color depth...' and 'Export...' dialogs.
It is also not indicated which quantization algorithm is used, even though their quality/speed can differ significantly.


Suggestion
color_depth_add_quantization_dithering.png

Color Quantization
  • add indication of which algorithm is in use OR add selector if more than one is available
  • add more quantization algorithms
    eg NeuQuant, Wu (like in RIOT)

    Algorithms overview
    Algorithm Quality Speed Typical use today Notes
    libimagequant / pngquant Excellent     Medium PNG/GIF export Widely considered the best practical modern quantizer
    K-means (optimized/perceptual) Excellent     Slow–Medium High-quality offline processing Often produces the best palettes when carefully tuned
    Wu quantization Very good    Very fast Real-time apps Excellent speed/quality balance
    NeuQuant Very good Medium GIF/video palettes Neural-network SOM approach
    Median Cut / MMCQ Good Fast UI palettes, thumbnails Simple and still widely used
    Octree    Fair–Good Very fast Embedded/realtime Memory-efficient
    PNN / Fast Pairwise Nearest Neighbor Excellent Slow Research/high quality Can outperform classic algorithms visually

Dithering
  • unify Dithering options for Grayscale and Indexed colors in:
    - Change color depth...
    - Export...
  • (optional) add standalone 'Dither...' action in Effects/Batch convert Actions (like in GIMP)
    to have all dither algos available in the app in a single list AND apply to an existing 8-bit image w/o additional palette re-quantization.
    Note: a caveat in GIMP is that it accepts full-color images as well, but does not reveal which color quantization is used (in theory user may have preferences).



    Comparison
    Rank Algorithm Type Strengths Weaknesses Best Use Cases
    1 Blue-noise hybrid Modern / Hybrid Best visual quality, minimal patterns, excellent gradients, GPU-friendly More complex implementation Modern image viewers, HDR, animation, GPU pipelines
    2 Sierra Lite Error diffusion Excellent quality/speed balance, fewer artifacts than Floyd Slightly softer detail Realtime image viewers, general-purpose dithering
    3 Stucki Error diffusion Very smooth gradients, high photographic quality Slower than Floyd/Sierra Lite High-quality photo quantization
    4 Jarvis–Judice–Ninke (JJN) Error diffusion Very smooth gradients, low visible artifacts Higher CPU cost Offline processing, high-quality still images
    5 Floyd–Steinberg Error diffusion Fast, simple, widely supported Directional “worm” artifacts Classic default dithering
    6 Atkinson Error diffusion Sharp retro look, preserves edges Reduced tonal accuracy Retro graphics, monochrome, pixel art
    7 Bayer ordered dithering Ordered Extremely fast, deterministic, GPU-friendly Visible repeating patterns Realtime rendering, UI, shaders, video


ref
https://en.wikipedia.org/wiki/Color_quantization
https://en.wikipedia.org/wiki/Dither
https://surma.dev/things/ditherpunk/
https://blog.maximeheckel.com/posts/the ... ading-web/





Example
  • color depth - quantization, dithering
    other_apps_color_depth.png
You do not have the required permissions to view the files attached to this post.


Last bumped by user0 on Fri May 29, 2026 2:03 am.