Jump to content
You must now use your email address to sign in [click for more info] ×

Gradient noise increase at stop


Recommended Posts

Using Affinity Designer or Photo 1.9.2 on Windows 10, I can see an abrupt increase of noise at the position of a gradient stop, which looks like this after applying a level adjustment to exaggerate it:

GradientBug.png.3be5ca59e8e9e090b5c5b5dd9c8940ce.png

The noise slider is set to the minimum value for all stops.

It's not extremely noticeable but still quite visible in some cases. I can reproduce it for example by simply creating a shape with a linear gradient, a black stop, a gray stop in the middle and a white stop.

An example file is attached.

GradientBug.afdesign

Link to comment
Share on other sites

  • Staff

Hi Jimmini,

This is intentional and is known as dithering. It is applied to gradients to smooth them out and avoid the typical banding issues you see may see without it. As you say the Levels Adjustment you've applied really pushes that and exacerbates the noise and makes it stand out a lot more.
Dither Gradients On:
image.png

Dither Gradients Off: image.png
 

Link to comment
Share on other sites

I understand the purpose of dithering, and I do want noise, but there shouldn't be such a sudden increase in noise that actually introduces visible seams. Such an artifact isn't needed for dithering, and seems like an implementation issue to me.

Link to comment
Share on other sites

  • 6 months later...

@Jimmini

The settings in Preferences only impacts rendering while in Designer. When you export your file in bitmap format (or merge / merge visible / flatten), the dithering will apply unavoidably.

You can deactivate the otherwise forced dithering with help of a workaround:

  1. Put the layer into a group
  2. Add an invisible layer fx to the group, e.g. overlay with 0% opacity

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

10 hours ago, NotMyFault said:

You can deactivate the otherwise forced dithering with help of a workaround

I'm not looking to disable dithering though. I do want it. In fact, I wish there was more of it in various situations.
The problem I'm trying to bring attention to is the artifact that this specific implementation of dithering produces.
To make it more clear (hopefully), here is a comparison between various gradients:

GradientBug2.png.47f9b12301e405cb1ced3cb217e5e0c1.png

The first is simply a black to white gradient. The second one is a darker gray to a lighter gray with levels applied on top. The third is the same as the second, except there is middle gray stop at the center, which produces the issue I'm talking about, namely the seam at the stop's location. The third is supposed to look like the second, but doesn't. The levels are just used to emphasize the issue, but it happens regardless. (The fourth is just something I stumbled upon when making this comparison, which is a another issue.)

GradientBug2.afdesign

Link to comment
Share on other sites

Well, affinity should simply implement a new live filter called „dither“, including sliders to control the algorithm and strength.

https://en.wikipedia.org/wiki/Dither

Until then, using noise as a workaround might be the option to get more control.

Or use gmic plugin, which provides a variety.

For me, having a forced dither is a bigger problem vs. using workarounds or 3rd party plugins.

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

I agree this is a bug. It seems dithering is broken at every inner node of the gradient. If you add more nodes (e.g. 25% 50% 75%), you get a seam at every node.

Dithering only works between two nodes pairs. If you have more nodes, you get partially correct dithering between every pair, but not across 3 or more.

There is a (destructive only) Filter>Noise>Dither showing smoother results, but you can't restrict it to gradients only.

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

On 6/18/2021 at 6:37 AM, Jimmini said:

which looks like this after applying a level adjustment to exaggerate it:

If you are exaggerating it then it is exaggerated. I personally don't see this as a bug,

Mac Pro (Late 2013) Mac OS 12.7.4 
Affinity Designer 2.4.1 | Affinity Photo 2.4.1 | Affinity Publisher 2.4.1 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Link to comment
Share on other sites

Just because I exaggerate it for demonstration purposes doesn't mean it's not a problem. I wouldn't have made this report if I hadn't noticed it in normal conditions. Not that adding adjustments would be an unusual thing to do. Seams at gradient stops seems like a pretty big deal to me for a professional image editing software.

Link to comment
Share on other sites

If this was smoothly interpolated across the stop then there would be no discontinuity, even when exaggerated. At least until you reach the granular resolution of the colour space.

image.png.25f04cf6a3dc312ebb746e9c71ec13a8.png

Here's a black to white RGB/8 gradient with a low noise level. The left has three stops the right two. The mid point grey colour is (128,128,128). To my eyes the right panel seems overall to be darker than the left. The noise is interpolated evenly over the centre line and is as expected. The left panel shows a clear discontinuity. I am stretching the colour space quite a bit using the adjustment in the OP supplied file. It is looking like the error propagation (noise) on the left panel approaches zero when it reaches the stop (moving from top to bottom) and then starts again as it gets darker. Sampling the image also makes it look like there is pure colour at that boundary and not a dithered colour. Of course (with my programmer hat on 😉) this is all correct and is probably as designed but as a designer I'd say this is less than desirable and not very useful. It is looking like the error approaches zero at the stops when (to be useful) it should only do that at the start and the end of the whole gradient - if at all. None of my testing takes into account the colour space transformation for the display profile, gamma correction etc. and these may be moving this to a non-linear interpolation which then might cause the dither to reveal the discontinuity. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.