Skip to content

avifdec does not output identical / pixel perfect PNGs #2916

@0fbcb238c0

Description

@0fbcb238c0

Decoding an AVIF using avifdec does result in a PNG with minute differences in image data.
I tested using SDR and HDR images, it happens with all files I've tested.

Choosing aom or dav1d does not make a difference in image hash, as calculated by ImageMagick's identify
Example image from avif-sample-images
kimono.avif -> kimono.png

 * Resolution     : 722x1024
 * Bit Depth      : 8
 * Format         : YUV420
 * Chroma Sam. Pos: 0
 * Alpha          : Absent
 * Range          : Limited
 * Color Primaries: 1
 * Transfer Char. : 13
 * Matrix Coeffs. : 9
 * ICC Profile    : Absent
 * XMP Metadata   : Absent
 * Exif Metadata  : Absent
 * Transformations:
    * pasp (Aspect Ratio)  : 1/1
 * Progressive    : Unavailable
 * Gain map       : Absent

Calculating the image hashes with the aforementioned identify shows this:

PNG 32014df7375ff7c42f9fa0318b4cd0317b67bb8b31429eda6bb88bccdc362078
AVIF f12b6a0b1a50303e6da7f8fdaa49ad30d7f9659517fe9cdbf8d15333687285f3

Converting the file with ImageMagick does work, but only for SDR images, as HDR information is lost with magick

PNG f12b6a0b1a50303e6da7f8fdaa49ad30d7f9659517fe9cdbf8d15333687285f3
AVIF f12b6a0b1a50303e6da7f8fdaa49ad30d7f9659517fe9cdbf8d15333687285f3

Decoding an HDR image has the same issue with differing image hashes.
The attached HDR image is an AVIF, renamed to .png due to GitHub limitations.

Image

 * Resolution     : 2048x858
 * Bit Depth      : 10
 * Format         : YUV444
 * Alpha          : Absent
 * Range          : Full
 * Color Primaries: 9
 * Transfer Char. : 16
 * Matrix Coeffs. : 9
 * ICC Profile    : Absent
 * XMP Metadata   : Absent
 * Exif Metadata  : Absent
 * Transformations: None
 * Progressive    : Unavailable
 * Gain map       : Absent
PNG 2652402b2a98973313152ddcf323aa757332ce621c7cc962783c5b82eb269da9
AVIF 1e9a43ca88013272d5f46e1ee91382c92f3001606098d0e4908da7c49667c2c6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions