Skip to content

Commit

Permalink
Clamp dither level
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Jul 8, 2024
1 parent bd08e34 commit 77dcaaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl SettingsExt {
// but don't change dithering unless gifsicle quality < 90, and don't completely disable it
let gifsicle_factor = 0.25 + f32::from(gifsicle_quality) * (1./100. * 1./0.9 * 0.75);

(f32::from(self.s.quality) * (1./50. * gifsicle_factor) - 1.).max(0.2)
(f32::from(self.s.quality) * (1./50. * gifsicle_factor) - 1.).clamp(0.2, 1.)
}
}

Expand Down

0 comments on commit 77dcaaa

Please sign in to comment.