Bug 406263 - png screenshot is big (5.9 MiB)
Summary: png screenshot is big (5.9 MiB)
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: VHI major
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-05 18:29 UTC by Patrick Silva
Modified: 2019-05-05 18:00 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.04.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2019-04-05 18:29:17 UTC
SUMMARY
I'm testing Spectacle 19.04 RC on Arch Linux.
I took a screenshot in "Full screen" mode, the size of the png file saved by spectacle is 5.9 MiB. The file is also big when other screenshot modes are used.

STEPS TO REPRODUCE
1. take a screenshot and save it as png file
2. 
3. 

OBSERVED RESULT
png file is big

EXPECTED RESULT
normal file size

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.56.0
Qt Version: 5.13.0 beta1
Comment 1 carl 2019-04-11 07:07:10 UTC
Looking at the size of my old screenshots, this is a regression.

optipng old_screeenshot.png => 25% reduction
optipng new_screenshot.png => 95% reduction
Comment 2 Christoph Feck 2019-04-11 07:24:20 UTC
Workaround: If you save as PNG, set Compression Quality to 0 in Spectacle settings. If you save as JPEG, the setting should be at least 50, or the quality is really bad.
Comment 3 Christoph Feck 2019-04-11 07:28:45 UTC
Actually, I noticed that setting the Compression Quality value to anything smaller than 90 is enough to force PNG compression.

I will change the default value from 90 to 89 for the 19.04.0 release. Then we have time to investigate how to best proceed.
Comment 4 Christoph Feck 2019-04-11 07:40:55 UTC
Discussion in https://phabricator.kde.org/D19591 revealed https://bugreports.qt.io/browse/QTBUG-43618
Comment 5 Christoph Feck 2019-04-11 07:54:44 UTC
Git commit 0f259d9be2bd6be8e8e28b46f22e5ba7d5720273 by Christoph Feck.
Committed on 11/04/2019 at 07:37.
Pushed by cfeck into branch 'Applications/19.04'.

Change default compression quality from 90 to 89

Qt's PNG ImageWriter (ab)uses setQuality() for setCompression(),
which causes "no compression" for any quality value larger than 89.
See https://bugreports.qt.io/browse/QTBUG-43618

For screenshots, which usually have large areas of flat colors,
uncompressed files are very large (e.g. 24 MB for a 4K screen).
Sharing screenshots directly is quite common, so users won't notice
immediately that they are sharing big files.

Changing the quality value from 90 to 89 doesn't severely degrade
quality for JPEG files until we find a better solution,

M  +1    -1    src/SpectacleConfig.cpp

https://commits.kde.org/spectacle/0f259d9be2bd6be8e8e28b46f22e5ba7d5720273
Comment 6 Nate Graham 2019-05-05 18:00:52 UTC
Git commit 879249b62570b3f6c5e9c4ca23bb4be0ec1a22c9 by Nate Graham, on behalf of David Redondo.
Committed on 05/05/2019 at 17:57.
Pushed by ngraham into branch 'Applications/19.04'.

Set compression to 50 is the format is png

Summary:
This reverts commit 0f259d9be2bd6be8e8e28b46f22e5ba7d5720273.

If no value for compression is set the png handler will fallback to using quality to determine compression resulting in huge files. See also the Discussion in D19591.
FIXED-IN: 19.04.1

Test Plan:
Save png with quality configured to 100.
The picture file should have a reasonable size.

Reviewers: #spectacle, cfeck, ngraham

Reviewed By: #spectacle, ngraham

Subscribers: shubham, #spectacle

Tags: #spectacle

Differential Revision: https://phabricator.kde.org/D20985

M  +9    -0    src/ExportManager.cpp
M  +1    -1    src/SpectacleConfig.cpp

https://commits.kde.org/spectacle/879249b62570b3f6c5e9c4ca23bb4be0ec1a22c9