diff --git a/src/main.rs b/src/main.rs index 24d5793..eb6d1eb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -335,10 +335,11 @@ fn apply_image_parameters(lr: *mut libraw_data_t, args: &Args) { libraw_set_use_auto_wb(lr, 0); } - // Apply saturation + // Apply saturation (use saturation multiplier, not gamma) if args.saturation != 0 && !lr.is_null() { - let value = 1.0 + args.saturation.min(100).max(-100) as f32 / 100.0; - libraw_set_gamma(lr, 0, value); // Apply gamma adjustment to simulate saturation + let mul = (256i32 + args.saturation.min(100).max(-100) as i32 * 2) as c_int; + let sat_mul = [mul, mul, mul, mul]; + libraw_set_saturation_mul(lr, sat_mul.as_ptr()); } // Set output color space (sRGB in this case)