Skip to content

Commit

Permalink
fix wrong implementation of unsharpen filter (#2079)
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliapixel authored Dec 24, 2023
1 parent 139e809 commit 7197841
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/imageops/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,9 @@ where
let ic: i32 = NumCast::from(c).unwrap();
let id: i32 = NumCast::from(d).unwrap();

let diff = (ic - id).abs();
let diff = ic - id;

if diff > threshold {
if diff.abs() > threshold {
let e = clamp(ic + diff, 0, max); // FIXME what does this do for f32? clamp 0-1 integers??

NumCast::from(e).unwrap()
Expand Down

0 comments on commit 7197841

Please sign in to comment.