Skip to main content

count_differing_pixels

Function count_differing_pixels 

Source
pub fn count_differing_pixels(a: &[u8], b: &[u8], threshold: u8) -> usize
Expand description

Count the number of pixels where any RGBA channel differs by more than threshold (0-255).

Both buffers must have the same length (width * height * 4).

ยงPanics

Panics if a.len() != b.len() or if the length is not a multiple of 4.