mirror of
https://github.com/tiennm99/rplace.git
synced 2026-10-11 03:13:48 +00:00
Brightness, contrast, saturation, and gamma adjustments before palette quantization. Pure-function applyColorCorrection in src/lib keeps the CLI and browser importer in sync. Inserted post-resize so slider moves stay responsive on large sources; precision loss is negligible through a 32-color palette. UI is a collapsible "Color correction" section with four sliders, live values, a "Reset" button, and an "on" badge when any value differs from default. CLI gains --brightness, --contrast, --saturation, --gamma (all -100..+100 except gamma which is 0.1..3.0). 9 unit tests pin down identity, saturate-to-0-or-255 clamping, greyscale at saturation=-100, gamma midtone direction, and alpha preservation.