Bug 431788

Summary: Add option available to not resample images in viewer
Product: [Applications] digikam Reporter: Quincy <bbc.quincy>
Component: Preview-ImageAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: benedekppeter, caulier.gilles, metzpinguin
Priority: NOR    
Version: 7.1.0   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed In: 8.5.0
Sentry Crash Report:
Attachments: Comparison gwenview vs. digikam

Description Quincy 2021-01-18 16:05:49 UTC
I'm trying to use digikam to manage a collection of scientific images where the information of a single pixel matters (TIFF format).

Up to now I browsed them with IrfanView (Windows) or Gwenview (Linux) as both of them are "capable" of displaying single pixels when zoomed in far enough: In IrfanView I can select to not use resampling while zooming (default is on), Gwenview seems not to have an option to use resampling at all. The (unchangeable) default in digiKam seems to always use resampling while zooming as the image will get "blurry" when zooming in very much.

So my wish would be an option to not use resampling, but display single (sized up) pixels when zooming in to that level. This may not only be useful for my special application, but also for people wanting to evaluate JPEG compression artifacts, blur of the image or similar things which are difficult to see when the resampling method already blurs the image.
Comment 1 caulier.gilles 2023-05-18 21:17:46 UTC
Which kind of scientific images exactly ? Can you share samples please ?
Comment 2 Quincy 2024-10-28 16:10:54 UTC
Created attachment 175310 [details]
Comparison gwenview vs. digikam

Unfortunately I was never notified of your answer via email, therefore I'm a bit late:
Images contain plants or plant parts as they could have been taken with a normal digital camera, but are compressed lossless (e.g. TIFF). Unfortunately I cannot share the original ones, but it does not really matter. We can also also use NASA images for example https://photojournal.jpl.nasa.gov/tiff/PIA26448.tif.

The only thing I'm talking about is this: At some high some level (1200% in this case) of zoom gwenview (left) does show the individual pixels clearly, while digikam (right) blurrs them.

I assume this is just some setting/option/argument in the underlying displaying library (Qt?!), but unfortunately I have no clue about how or where this happens to compare between gwenview and digikam (not any Qt experience).
Comment 3 Maik Qualmann 2024-10-28 20:22:15 UTC
We have our own code for scaling, which originally came from Imlib2. We have developed it further, added 16-bit support and fixed crashes with large files. This code currently has no way to disable blurring of pixels.

Now comes my personal opinion. I really like our scaler for photos. Qt's own scaler has 2 methods, fast and smooth. Qt-Smooth is OK, but nowhere near as good as digiKam's. For people who want/need to see pixels, it may not be as good.

When I have time, I will take another look at our scaler to see if we can optionally disable blurring.

Maik
Comment 4 Maik Qualmann 2024-10-31 16:23:54 UTC
Git commit a4e374e99708bd16dfdd6815e15adf8a52dbcccf by Maik Qualmann.
Committed on 31/10/2024 at 16:23.
Pushed by mqualmann into branch 'master'.

implement the option to disable smooth scaling
Not yet implemented in the GUI
Related: bug 491580

M  +3    -2    core/libs/dimg/dimg.h
M  +34   -30   core/libs/dimg/dimg_scale.cpp

https://invent.kde.org/graphics/digikam/-/commit/a4e374e99708bd16dfdd6815e15adf8a52dbcccf
Comment 5 Maik Qualmann 2024-10-31 20:24:48 UTC
Git commit a0d00ea0c8971ae014106c54e2b6ce36a2d19c26 by Maik Qualmann.
Committed on 31/10/2024 at 20:22.
Pushed by mqualmann into branch 'master'.

add configuration options for Anti-aliasing image upscaling
Note: this Image Preview option also works on the Image Editor.
Related: bug 491580
FIXED-IN: 8.5.0

M  +2    -2    NEWS
M  +5    -0    core/libs/settings/applicationsettings.cpp
M  +7    -5    core/libs/settings/applicationsettings.h
M  +12   -0    core/libs/settings/applicationsettings_iconview.cpp
M  +4    -2    core/libs/settings/applicationsettings_p.h
M  +2    -1    core/libs/widgets/graphicsview/graphicsdimgitem.cpp
M  +7    -0    core/libs/widgets/graphicsview/imagezoomsettings.cpp
M  +4    -0    core/libs/widgets/graphicsview/imagezoomsettings.h
M  +2    -1    core/utilities/imageeditor/widgets/imagepreviewitem.cpp
M  +2    -1    core/utilities/imageeditor/widgets/imageregionitem.cpp
M  +9    -2    core/utilities/setup/album/setupalbumview.cpp

https://invent.kde.org/graphics/digikam/-/commit/a0d00ea0c8971ae014106c54e2b6ce36a2d19c26
Comment 6 Quincy 2024-11-03 10:13:07 UTC
Downloaded digiKam-8.5.0-20241102T170111-Qt6-x86-64.appimage for testing - works exactly as expected!

For "artistic" photos the scaler is fine and does what it should do, for the purposes outlined here it is not that suitable, but that is also a bit beyond digikams usual use case.

Given that I'm especially thankful for the enhancement broadening digikams use case. Many thanks Maik!
Comment 7 Peter 2024-11-03 18:03:27 UTC
(In reply to Quincy from comment #6)
> Downloaded digiKam-8.5.0-20241102T170111-Qt6-x86-64.appimage for testing -
> works exactly as expected!
> 
Where can I enable this?
Comment 8 caulier.gilles 2024-11-03 18:22:55 UTC
here :

https://i.imgur.com/akM3kcy.png

Gilles Caulier
Comment 9 Peter 2024-11-03 18:38:48 UTC
(In reply to caulier.gilles from comment #8)
> here :
> 
> https://i.imgur.com/akM3kcy.png
> 
> Gilles Caulier

Thank you Gilles!