mirror of
https://github.com/opencv/opencv.git
synced 2026-11-09 18:04:29 -06:00
doc(imgcodecs): update 16-bit support and opaque alpha channel behavior for AVIF(4.x)
- Reading and writing 16-bit AVIF images requires libavif v1.4.0+ - Note that if the alpha plane contains only fully opaque pixels, the destination saves only color channels due to a libavif limitation. Port from https://github.com/opencv/opencv/pull/30519
This commit is contained in:
@@ -552,10 +552,11 @@ can be saved using this function, with these exceptions:
|
||||
Fully transparent pixels should have an alpha value of 0, while fully opaque pixels should have an alpha value of 255.
|
||||
- 8-bit single-channel images (CV_8UC1) are not supported due to GIF's limitation to indexed color formats.
|
||||
- With AVIF encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved.
|
||||
- CV_16U images can be saved as only 10-bit or 12-bit (not 16-bit). See IMWRITE_AVIF_DEPTH.
|
||||
- CV_16U images can be saved as only 10-bit or 12-bit (and 16-bit with libavif 1.4.0+). See @ref IMWRITE_AVIF_DEPTH.
|
||||
- AVIF images with an alpha channel can be saved using this function.
|
||||
To achieve this, create an 8-bit 4-channel (CV_8UC4) / 16-bit 4-channel (CV_16UC4) BGRA image, ensuring the alpha channel is the last component.
|
||||
Fully transparent pixels should have an alpha value of 0, while fully opaque pixels should have an alpha value of 255 (8-bit) / 1023 (10-bit) / 4095 (12-bit) (see the code sample below).
|
||||
Fully transparent pixels should have an alpha value of 0, while fully opaque pixels should have an alpha value of 255 (8-bit) / 1023 (10-bit) / 4095 (12-bit) / 65535 (16-bit) (see the code sample below).
|
||||
Note that if the alpha plane contains only fully opaque pixels, the destination saves only color channels due to a libavif limitation.
|
||||
|
||||
If the image format is not supported, the image will be converted to 8-bit unsigned (CV_8U) and saved that way.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user