Conversation
Signed-off-by: wfatih <ckrfth.s@gmail.com>
Contributor
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Contributor
|
✅ DCO Check Passed Thanks @wfatih, all your commits are properly signed off. 🎉 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ImageDocumentBackendconverts every frame withframe.convert("RGB"). That drops the alpha channel and keeps whatever colour is stored under it, and for fully transparent pixels that is usually black. A PNG with dark text on a transparent background (RGBA, LA, or palette +tRNS) therefore becomes an all-black page, and the text is invisible to layout and OCR:This adds
_to_rgb(), which composites frames that have an alpha channel or atransparencyentry onto a white background before the RGB conversion, the same white a PDF page has behind its content. Frames without transparency still go through a plainconvert("RGB"), so their output doesn't change.The new test, parametrised over RGBA, LA and P +
tRNS, checks that the transparent background comes out white and the opaque content stays black. It fails onmain(3 failed) and passes with this change.tests/test_backend_image_native.py(30 passed) andtests/test_input_doc.py(24 passed) pass, and no groundtruth changes: the only RGBA test image (a TIFF) is fully opaque.Checklist: