Bug 469109 - Gradient dither adds dither to areas which are supposed to be transparent
Summary: Gradient dither adds dither to areas which are supposed to be transparent
Status: CONFIRMED
Alias: None
Product: krita
Classification: Applications
Component: Tools (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-28 14:58 UTC by Raghavendra kamath
Modified: 2023-08-07 16:10 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raghavendra kamath 2023-04-28 14:58:29 UTC
SUMMARY
Adding a gradient with dithering enabled adds dither to areas which are transparent. The pattern really very transparent but it becomes obvious when you duplicate the layer 10 to 15 times or just load a selection by selecting opaque or ctrl clicking on layer thumbnail. 

This pattern gives issues when other effects like mean removal or sharpening are applied or if the layer has multiply blend mode.

This also makes the element larger and it becomes a hassle when transforming things as small elements can actually be entire canvas.

STEPS TO REPRODUCE
1. Open a new document
2. Delete the background layer content to make the document with transparent background
3. Add a small radial gradient in a corner anywhere with black colour. the preset for the gradient is foreground to transparent.
4. Load a selection based on this layer by ctrl clicking on the layer thumbnail or right click and do select opaque. 

OBSERVED RESULT
Dithers are present across the canvas 

EXPECTED RESULT
Dithering should only be present in place of colour and opaque region
Comment 1 amyspark 2023-05-01 01:08:18 UTC
Hi! From a look at the original Inkscape code and my notes, I think this particular case was never expected or acted on. The testing was only done on fully opaque ramp gradients (which were the most affected).

I'll raise the topic at tomorrow's meeting, but in the meanwhile, do you have any suggestions on how to handle partial transparency?
Comment 2 Deif Lou 2023-05-01 14:24:28 UTC
Would having 2 separate dithering options, for color channels and transparency help? That way the users can choose themselves, depending on they whant to achieve.
Comment 3 Bug Janitor Service 2023-05-16 03:46:05 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Raghavendra kamath 2023-05-16 05:20:02 UTC
I think as deif lou suggests an option to ignore area with transparency would be good. It is okay to add dither to partially transparent area but not for fully transparent area.

Also setting it to reported again since this will be closed by bug janitor in 30 days without any resolution.
Comment 5 tomtomtomreportingin 2023-06-10 03:27:22 UTC
To be honest, making it an option rather than simply fixing the issue seems unnecessary. It's hard to imagine a usecase for dithered transparency side effects from a gradient, that requires a user to duplicate the layer mutliple times to even notice. Best to not overcomplicate things, in my opinion, unless someone really thinks it would improve their workflow (why not just use a noise filter if you want transparency dither?).
Comment 6 Raghavendra kamath 2023-06-10 06:36:18 UTC
I too was of the same opinion. I suggested for not adding the option on the IRC. but deif lour said that currently the colour in end point of the gradient is extended so if the gradient is from black to white the white is filled till the end of the canvas no matter where the user places the last end point. So by that logic krita extends the transparency till the end and that is why dithering is applied to whole canvas no matter where you end your gradient, since the fill is extended  till the edge of the canvas. Hope I explained it correctly.

If we end the gradient where the user places the last end point it would break the existing behavior of coloured gradient. We should check what other software do in this situation.
Comment 7 Deif Lou 2023-06-10 06:57:05 UTC
Maybe it's just enough preventing the dithering on fully trandparent areas of the final applied gradient. My concern is that it may be some noticeable discontinuity where a fully transparent region meets a partially transparent one, but that's only speculation, it should be tested empirically.
Comment 8 tomtomtomreportingin 2023-06-10 15:22:28 UTC
Agreed.