-
Notifications
You must be signed in to change notification settings - Fork 128
White threshold for scanned PDFs (MuPDF) #2115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
I'm not sure if a custom implementation necessarily makes sense if libk2pdfopt already has it? If a custom implementation does make sense it feels more like a generic thing than something specific for MuPDF. |
|
I've not looked at what libk2pdfopt does, but leptonica provides some function for gamma correction and contrast enhancement, no? |
|
I also experimented with libk2pdf because yes, it does have native white threshold and it works, but I thought it's a good thing to have regardless of whether Dewatermark is on or off. |
…d without making everything pure white
I left a comment in issue #13294 about brightness/contrast of scanned PDFs. But then I saw the amount of open issues in the main
koreaderrepo and decided to experiment myself, and I think I might have found a decent solution for this.The solution would contain 3 pull requests (for
koreader,koreader-base(this one) andlibk2pdfopt) and would add option 'white threshold'.libk2pdfoptnatively has it (and I created a pull request for it as well), but for MuPDF (here inkoreader-base) I had to write my implementation, and it actually looks quite good:I know literally nothing about Lua or contributing to open source, so chances I've made a mistake somewhere are not zero, please keep in mind.
This change is