image icon indicating copy to clipboard operation
image copied to clipboard

Some TIFF images with alpha decoded incorrectly

Open Shnatsel opened this issue 3 years ago • 3 comments

This happens in image v0.24.2

Actual behaviour

The attached files are rendered differently by image compared to imagemagick and GIMP. Specifically, the yellow color in the bottom right corner is different.

Expected

No discrepancies

Reproduction steps

use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    use image::io::Reader as ImageReader;
    let input = std::env::args().nth(1).unwrap();
    let output = std::env::args().nth(2).unwrap();
    
    let img = ImageReader::open(input)?.decode()?;
    img.save(output)?;
    Ok(())
}

invoked with image-convert in.tiff out.png

tiff-mismatches-alpha.tar.gz

Shnatsel avatar Jul 04 '22 00:07 Shnatsel

Another image with improper alpha handling: strike.tif.gz

Shnatsel avatar Jul 04 '22 01:07 Shnatsel