Bug 361036 - No support for 30bpp X11 display
Summary: No support for 30bpp X11 display
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-27 11:48 UTC by Martin Herkt
Modified: 2021-11-16 04:11 UTC (History)
1 user (show)

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


Attachments
xdpyinfo output (32.14 KB, text/plain)
2016-03-27 14:10 UTC, Martin Herkt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Herkt 2016-03-27 11:48:46 UTC
Spectacle only supports 24bpp and will not work correctly with a 30bpp X11 display. It loses a few bits, resulting in wrong colors.

Reproducible: Always

Steps to Reproduce:
1. Set the display depth to 30 bpp in your Xorg configuration. E.g. NVIDIA drivers support this; recommended to use 364.12 (beta as of writing) or newer as that fixes a number of issues related to full 30bpp support.
2. Run Spectacle and take a screenshot

Actual Results:  
24bpp Screenshot with mangled colors

Expected Results:  
30bpp Screenshot with correct colors (converted to 24bpp or 48bpp if the file format does not support it)
Comment 1 Boudhayan Gupta 2016-03-27 14:00:11 UTC
Right, this is something we're interested in. Do you know what the pixel format is in a 30bpp XImage? Or could you point us to someone who does?
Comment 2 Martin Herkt 2016-03-27 14:10:44 UTC
Created attachment 98112 [details]
xdpyinfo output
Comment 3 Martin Herkt 2016-03-27 14:14:30 UTC
Whew, no idea if that helps, but I’ve attached xdpyinfo output.
Comment 4 Boudhayan Gupta 2016-03-27 14:46:57 UTC
Goldmine. Thanks, I'll get this done in time for the next release (16.04)
Comment 5 Martin Herkt 2016-03-27 14:50:50 UTC
Awesome. Poke me if you need me to test patches. I’m lachs0r @ freenode.
Comment 6 Boudhayan Gupta 2016-03-27 16:05:24 UTC
Git commit 83ef53e30c593642416a2d8c2f6ef950ffe112f3 by Boudhayan Gupta.
Committed on 27/03/2016 at 16:04.
Pushed by bgupta into branch 'Applications/16.04'.

Use QImage's 30bpp BGR image format for 30bpp XImage
FIXED-IN: 16.04

M  +3    -12   src/PlatformBackends/X11ImageGrabber.cpp

http://commits.kde.org/kscreengenie/83ef53e30c593642416a2d8c2f6ef950ffe112f3
Comment 7 Boudhayan Gupta 2016-03-27 17:41:43 UTC
Is this fixed? I have no way to test.
Comment 8 Martin Herkt 2016-03-27 17:43:31 UTC
Yes, it is. At least I get correct colors now :)
Now if it could save at higher bit depth as well, that would be the icing on the cake.
Comment 9 Boudhayan Gupta 2016-03-27 17:44:55 UTC
Qt's image processor can only handle 8 bits per component. Format_BGR30 just downscales 10bits of precision to 8bits. You'll have to file a QTBUG for this :-(
Comment 10 Mia Herkt 2021-11-13 19:33:51 UTC
Looks like it’s regressed as of Spectacle 21.08.3. More precisely it looks like the color channels are swapped.
Comment 11 Mia Herkt 2021-11-16 04:11:54 UTC
(In reply to Mia Herkt from comment #10)
> Looks like it’s regressed as of Spectacle 21.08.3. More precisely it looks
> like the color channels are swapped.

Actually fixed in e6d64481699c5bfac8d552455c0ffc2a8ac68f4f: https://invent.kde.org/graphics/spectacle/-/commit/e6d64481699c5bfac8d552455c0ffc2a8ac68f4f