Skip to content
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

feat: add option to use JPEG compression #13

Merged
merged 1 commit into from
Jan 28, 2024

Conversation

Krifto
Copy link
Contributor

@Krifto Krifto commented Jan 26, 2024

With the default setup, scanned pages take multiple megabytes. The newly added USE_JPEG_COMPRESSION environment variable enables JEPG compression (quality factor 80), significantly reducing file sizes.

see https://codeyarns.com/tech/2010-04-12-graphicsmagick-compression-methods.html

With the default setup, scanned pages take multiple megabytes.
The newly added USE_JPEG_COMPRESSION environment variable enables
JEPG compression (quality factor 80), significantly reducing
file sizes.

see https://codeyarns.com/tech/2010-04-12-graphicsmagick-compression-methods.html
@PhilippMundhenk
Copy link
Owner

Thank you for the contribution! Love it! Did happen to have tested this with OCR? I wonder if this impacts OCR quality, if not this could even be enabled by default

@PhilippMundhenk PhilippMundhenk merged commit bdf8288 into PhilippMundhenk:master Jan 28, 2024
@Krifto
Copy link
Contributor Author

Krifto commented Jan 28, 2024

Thanks for incorporating! I have not tried OCR, since I do all the OCR in paperless-ngx. But that also just uses Tesseract, and I have been feeding that with 300 resolution and JPEG quality 80 for about a year now without any issues.

A further idea could be to also expose the graphicsmagic's quality setting via envronment variable, which controls the amount of compression. But that would take some parameter sanitizing (clamp values to 0-100), and that is beyond my shell script skills :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants