Bug 461012 - Feature request: Add a possibility for image to ignore color change
Summary: Feature request: Add a possibility for image to ignore color change
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified All
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-26 11:10 UTC by Choca
Modified: 2023-10-18 19:47 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Choca 2022-10-26 11:10:56 UTC
When you open an Image with inverted color mode I would like to have the possibility for the image to remain as the original onr.

STEPS TO REPRODUCE
1. Open pdf
2.  Use the invert color mode or any other mode
3. Look at the pdf

OBSERVED RESULT
The image is inverted which does not help readability.

EXPECTED RESULT
As expected

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 cipricus 2022-10-26 12:16:40 UTC
The only use for color change in images seem to be when the images are images of text. In many cases they are not, so changing their colors is not useful and should be optional.
Comment 2 Laura David Hurka 2022-10-26 14:31:48 UTC
You forget the superweapon of digitalization: scanned PDFs. ;)
Comment 3 cipricus 2022-10-26 20:30:36 UTC
(In reply to David Hurka from comment #2)
> You forget the superweapon of digitalization: scanned PDFs. ;)

There are indeed many pdf files made out of images (that is: images of text), but not most of them, and many are a mix of text (not image) and image (pictures, pictural forms, not text). For the latter it makes no sense whatsoever to see them inverted or with their colors modified according to a setting that makes sense only for text. Therefore an option not to apply to image the color for text (non-image text) would be great. (e.g. such option is present in Foxit Reader for Linux).
Comment 4 Daniel 2023-10-18 19:47:01 UTC
This is a very interesting and highly desired feature for me (personal issues reading from a big screen).

I've found out that Zathura performs recoloring w/o affecting images. It does so by retrieving the list of images of the page with the corresponding coordinates and then skipping those during the recolor. 

Okular's recoloring is happening in https://github.com/KDE/okular/blob/master/gui/pagepainter.cpp#L689 but that function has no access to the PDF details as they're hidden behind the abstract interface of the Generator which does not provide any details.

Unfortunately, my try to add bool Generator::mediaBoxes(QList<QRect>& boxes) const and pass those boxes to recolor has failed around trying to get the Generator for the page :( I didn't even get to transforming the boxes according to the page.

Anyway, both hands for that feature.