Skip to content

Corrections on bKGD chunk writing and reading in PNG#26835

Merged
asmorkalov merged 3 commits intoopencv:4.xfrom
sturkmen72:patch-4
Jan 25, 2025
Merged

Corrections on bKGD chunk writing and reading in PNG#26835
asmorkalov merged 3 commits intoopencv:4.xfrom
sturkmen72:patch-4

Conversation

@sturkmen72
Copy link
Copy Markdown
Contributor

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@asmorkalov asmorkalov requested a review from vrabaud January 24, 2025 06:10
@sturkmen72 sturkmen72 changed the title [WIP] Corrections on bKGD chunk writing and reading Corrections on bKGD chunk writing and reading Jan 24, 2025
@sturkmen72 sturkmen72 marked this pull request as draft January 24, 2025 07:39
@sturkmen72
Copy link
Copy Markdown
Contributor Author

let me update the PR after #26832 merged

@vrabaud
Copy link
Copy Markdown
Contributor

vrabaud commented Jan 24, 2025

THat chunk actually depends on the color type that is used according to the spec. It can be:

  • the color as RGB for color type 2 or 6
  • an index in the palette for color type 3
  • the color as gray for color type 0 and 3

And it also depends on the bit depth.

@asmorkalov
Copy link
Copy Markdown
Contributor

@sturkmen72 The related PR has been merged.

@sturkmen72
Copy link
Copy Markdown
Contributor Author

THat chunk actually depends on the color type that is used according to the spec. It can be:

  • the color as RGB for color type 2 or 6
  • an index in the palette for color type 3
  • the color as gray for color type 0 and 3

And it also depends on the bit depth.

i think for now the proposed changes suitable for the color as RGB for color type 2 or 6
for gray images maybe we can skip saving bgcolor for now

@sturkmen72 sturkmen72 marked this pull request as ready for review January 24, 2025 11:58
@sturkmen72 sturkmen72 requested a review from vrabaud January 24, 2025 11:59
@asmorkalov asmorkalov added this to the 4.12.0 milestone Jan 24, 2025
@asmorkalov asmorkalov changed the title Corrections on bKGD chunk writing and reading Corrections on bKGD chunk writing and reading in PNG Jan 25, 2025
@asmorkalov asmorkalov merged commit d4eed1c into opencv:4.x Jan 25, 2025
@sturkmen72 sturkmen72 deleted the patch-4 branch January 25, 2025 18:49
@asmorkalov asmorkalov mentioned this pull request Feb 19, 2025
NanQin555 pushed a commit to NanQin555/opencv that referenced this pull request Feb 24, 2025
Corrections on bKGD chunk writing and reading in PNG opencv#26835 

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants