Skip to content

16-bit APNG Reading and Writing Problems #26825

Closed
@sturkmen72

Description

@sturkmen72

System Information

OpenCV version: 4.12.0-dev

Detailed description

The imreadanimation function currently fails to properly read specific 16-bit APNG files, including those with 2 channels (grayscale + alpha). Sample images for testing can be found in the APNGKit repository:
033.png
034.png
035.png

A possible solution could be to read 2-channel APNG images as 4-channel images, similar to how imread (as far as I know) processes 2-channel standard PNGs as 4-channel images.

Additionally, the imwriteanimation function currently converts 16-bit frames to 8-bit before saving. Would it be feasible to support saving 16-bit APNGs if there is a real need for it? (I did not find any 16-bit APNG files except for the mentioned test files.)

I am planning to work on this issue, and any feedback would be helpful.

Steps to reproduce

import cv2 as cv
import numpy as np

animation = cv.Animation()
filename = "034.png"
success, animation = cv.imreadanimation(filename)
cv.imshow("Frame", animation.frames[0])
cv.waitKey()

also take a look on related test code

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy