Skip to content

avifgainmaputil color differs from avifenc #3102

@BPplays

Description

@BPplays

im having an issue where gainmaps generated with avifgainmaputil seem to be shifted toward red in some areas vs avifenc; it happens in both a chromium based browser and tev, it's more obvious in HDR but it's still visible in SDR on stuff like the yellow bushes and the grass in the bottom left

sdr_compare.png


outside3-v1-sdr-1-13-1-noicc.avif
SDR

-> avifenc -d 12 -q 100 --qalpha 100 -y 444 --range full --cicp 1/13/1 --ignore-profile .\outside3-v1-sdr.png .\outside3-v1-sdr-1-13-1-noicc.avif
Successfully loaded: .\outside3-v1-sdr.png
Quality set to 100, assuming --lossless to enable warnings on potential lossless issues.
WARNING: [--lossless] Input data was RGB and matrixCoefficients isn't set to identity (--cicp x/x/0) or YCgCo-Re/Ro (--cicp x/x/16 or x/x/17); Output might not be lossless.
AVIF to be written: (Lossy)
 * Resolution     : 4064x3044
 * Bit Depth      : 12
 * Format         : YUV444
 * Alpha          : Absent
 * Range          : Full
 * Color Primaries: 1
 * Transfer Char. : 13
 * Matrix Coeffs. : 1
 * ICC Profile    : Absent
 * XMP Metadata   : Present (868 bytes)
 * Exif Metadata  : Absent
 * Transformations: None
 * Progressive    : Unavailable
 * Gain map       : Absent
Encoding with initial settings: codec 'aom' speed [6], color quality [100 (Lossless)], alpha quality [100 (Lossless)], automatic tiling, 32 worker thread(s), please wait...
Encoded successfully.
 * Color total size: 29383256 bytes
 * Alpha total size: 0 bytes
Wrote AVIF: .\outside3-v1-sdr-1-13-1-noicc.avif

outside3-v1-hdr-9-16-9-noicc.avif
HDR

-> avifenc -d 12 -q 100 --qalpha 100 -y 444 --range full --cicp 9/16/9 --ignore-profile .\outside3-v1-hdr.png .\outside3-v1-hdr-9-16-9-noicc.avif
libpng warning: iCCP: profile 'Rec. 2020 PQ': 0h: PCS illuminant is not D50
Successfully loaded: .\outside3-v1-hdr.png
Quality set to 100, assuming --lossless to enable warnings on potential lossless issues.
WARNING: [--lossless] Input data was RGB and matrixCoefficients isn't set to identity (--cicp x/x/0) or YCgCo-Re/Ro (--cicp x/x/16 or x/x/17); Output might not be lossless.
AVIF to be written: (Lossy)
 * Resolution     : 4064x3044
 * Bit Depth      : 12
 * Format         : YUV444
 * Alpha          : Absent
 * Range          : Full
 * Color Primaries: 9
 * Transfer Char. : 16
 * Matrix Coeffs. : 9
 * ICC Profile    : Absent
 * XMP Metadata   : Present (1243 bytes)
 * Exif Metadata  : Absent
 * Transformations: None
 * Progressive    : Unavailable
 * Gain map       : Absent
Encoding with initial settings: codec 'aom' speed [6], color quality [100 (Lossless)], alpha quality [100 (Lossless)], automatic tiling, 32 worker thread(s), please wait...
Encoded successfully.
 * Color total size: 17976031 bytes
 * Alpha total size: 0 bytes
Wrote AVIF: .\outside3-v1-hdr-9-16-9-noicc.avif

outside3-v1-gainmap_1-13-1__9-16-9.avif
gainmap

-> avifgainmaputil combine `
>     .\outside3-v1-sdr.png `
>     .\outside3-v1-hdr.png `
>     .\outside3-v1-gainmap_1-13-1__9-16-9.avif `
>     -d 12 `
>     -q 100 `
>     --qalpha 100 `
>     -y 444 `
>     --depth-gain-map 12 `
>     --qgain-map 100 `
>     --cicp-base "1/13/1" `
>     --cicp-alternate "9/16/9" `
>     --ignore-profile
libpng warning: iCCP: profile 'Rec. 2020 PQ': 0h: PCS illuminant is not D50
Creating a gain map of size 4064 x 3044
AVIF to be written:
 * Resolution     : 4064x3044
 * Bit Depth      : 12
 * Format         : YUV444
 * Alpha          : Absent
 * Range          : Full
 * Color Primaries: 1
 * Transfer Char. : 13
 * Matrix Coeffs. : 1
 * ICC Profile    : Absent
 * XMP Metadata   : Present (868 bytes)
 * Exif Metadata  : Absent
 * Transformations: None
 * Progressive    : Unavailable
 * Gain map       : 4064x3044 pixels, 12 bit, YUV444, Full Range, Matrix Coeffs. 2, Base Image is SDR
 * Alternate image:
    * Color Primaries: 9
    * Transfer Char. : 16
    * Matrix Coeffs. : 9
    * ICC Profile    : Absent
    * Bit Depth      : 12
    * Planes         : 3

Encoding AVIF at quality 100 speed 6, please wait...
Wrote AVIF: .\outside3-v1-gainmap_1-13-1__9-16-9.avif

-> avifgainmaputil
Command name missing

Experimental tool to manipulate avif images with HDR gain maps.

usage: avifgainmaputil <command> [options] [arguments...]

Available commands:
  help            Prints a command's usage
  combine         Creates an avif image with a gain map from a base image and an alternate image.
  convert         Convert a jpeg with a gain map to avif.
  tonemap         Tone maps an avif image that has a gain map to a given HDR headroom (how much brighter the display can go compared to an SDR display)
  swapbase        Swaps the base and alternate images (e.g. if the base image is SDR and the alternate is HDR, makes the base HDR). The alternate image is the result of fully applying the gain map.
  extractgainmap  Saves the gain map of an avif file as an image
  printmetadata   Prints the metadata of the gain map of an avif file

Version: 1.3.0 (dav1d [dec]:1.5.1-0-g42b2b24, aom [enc]:3.12.1)
libyuv : available (1909)
-> avifenc --version
Version: 1.3.0 (dav1d [dec]:1.5.1-0-g42b2b24, aom [enc]:3.12.1)
libyuv : available (1909)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions