ENH: Add level parameter to compress_content_streams#2044
Merged
MartinThoma merged 2 commits intomainfrom Aug 2, 2023
Merged
Conversation
File File name size The suffix is the compression level ------------------- 5321132 GeoTopo.pdf 9959402 out-0.pdf 5976025 out-1.pdf 5914204 out-2.pdf 5885818 out-3.pdf 5816263 out-4.pdf 5762359 out-5.pdf 5738259 out-6.pdf 5731877 out-7.pdf 5726121 out-8.pdf 5725267 out-9.pdf Level 1 gives a very good improvement, but already level 2 might not be worth the CPU cycles See #1910
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2044 +/- ##
=======================================
Coverage 94.17% 94.17%
=======================================
Files 41 41
Lines 7332 7332
Branches 1441 1441
=======================================
Hits 6905 6905
Misses 266 266
Partials 161 161
☔ View full report in Codecov by Sentry. |
pubpub-zz
approved these changes
Jul 30, 2023
Member
Author
|
Thanks for the improvement suggestions @stefan6419846 and thank you for the review @pubpub-zz 🙏 |
MartinThoma
added a commit
that referenced
this pull request
Aug 6, 2023
### New Features (ENH) - Add `level` parameter to compress_content_streams (#2044) - Process /uniHHHH for text_extract (#2043) ### Bug Fixes (BUG) - Fix AnnotationBuilder.link (#2066) - JPX image without ColorSpace (#2062) - Added check for field /Info when cloning reader document (#2055) - Fix indexed/CMYK images (#2039) ### Maintenance (MAINT) - Cryptography as primary dependency (#2053) [Full Changelog](3.14.0...3.15.0)
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.
Provide more options / details on how to reduce the file size with compression.
See #1910
A small experiment
Level 1 gives a very good improvement, but already level 2 might not be worth the CPU cycles.
Interestingly, the original is smaller than the best compression⚠️