New feature: black and white color mode - #229
Conversation
|
Thanks a lot for your PR! |
|
I just received an email with an error:
Looks like this has been pending for a month and expired now. Is this still on your radar? |
|
It is on my radar, but I didn't manage to work on it so far. I'm sorry for that. |
|
Thanks again for this pull request! Here are my thoughts:
About the "two things unrelated to the feature":
I don't see that. Did I miss something?
Yes, but it's minor (25ms per page), so we can handle it separately. I started a new branch based on your code to:
It's not ready to be merged:
Would you like to have a look at it and tell me whether this could be a good starting point for further discussion? No rush. And sorry for the time it took me. |
Implements the black and white mode from #150. Measurements are in the issue comment.
Adds
ColorMode.BLACK_AND_WHITE, selectable per page and as a default in the settings. The binarization runs on the output of the existing grayscale pipeline and adds a Sauvola threshold. PDF export embeds these pages as 1 bit per pixel with CCITT group 4, rebuilt from the original capture. Automatic detection never selects the new mode, page geometry and the other two modes are untouched, and there is no new dependency.Three things you may want to decide differently:
While measuring I also noticed two things unrelated to the feature: during export the page image was fetched twice per page, and the OCR bitmap was decoded even when no OCR language is enabled. Both are fixed in this branch, since they distorted my numbers. I can split them into a separate PR if you prefer.
Tested on a device and with
./gradlew clean license check assembleRelease.