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

Disable grim's png compression #3612

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MaeIsBad
Copy link
Contributor

Grim by default used level 6 for compressing PDFs, which could take as long as a second depending on the hardware. This caused a big delay when taking a screenshot with grim, leading to a bad user experience. This commit sets the compression level to 0(uncompressed) radically speeding up the process of taking a screenshot(down to just a few ms on my machine).

Grim by default used level 6 for compressing PDFs, which could take as
long as a second depending on the hardware. This caused a big delay when
taking a screenshot with grim, leading to a bad user experience.
This commit sets  the compression level to 0(uncompressed) radically
speeding up the process of taking a screenshot.
@MaeIsBad MaeIsBad changed the title Disable grims png compression Disable grim's png compression May 18, 2024
@mmahmoudian
Copy link
Member

I'm not sure how I feel about this. On one hand you are right that it speeds up the process, on the other hand it will result in much larger PNGs (benchmarking is needed to assess how large). Perhaps a better way is to allow the user to adjust this value, potentially via a slider.

Also, before you wonder, I generally don't merge code changes unless is approved my one of the devs. As for this PR, perhaps we should wait for opinion of other devs too.

Thanks again for this PR.

@MaeIsBad
Copy link
Contributor Author

I'm not sure how I feel about this. On one hand you are right that it speeds up the process, on the other hand it will result in much larger PNGs (benchmarking is needed to assess how large). Perhaps a better way is to allow the user to adjust this value, potentially via a slider.

This is not an issue. Flameshot recompresses the image on it's own when saving the image regardless, meaning this change doesn't impact the final file size

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.

None yet

2 participants