Jimmini Posted June 18, 2021 Share Posted June 18, 2021 First, gradient stop interpolation is currently not being done in linear space. Here is how it currently looks like: How it should look like: This doesn't only affect the distribution of the two colors being interpolated but also what colors are produced in-between: How it should look like: I thought about posting this in the bug reporting section, but as it might have artistic utility to do it this way and for compatibility reasons, I guess it fits better in here as a suggestion for an option. In fact, there could simply be a gamma setting in the gradient popup, just like in the layer blending options, which could be set to 1.0 for a "correct" interpolation. Secondly, as it is closely related, another suggestion I have is an interpolation easing option, which can produce much smoother gradients, among other things. For example, using cubic interpolation: Thanks, I hope you consider adding such options. Quote Link to comment Share on other sites More sharing options...
garrettm30 Posted June 18, 2021 Share Posted June 18, 2021 Your post is interesting, and at the pure aesthetic level I do prefer what you say it should be rather than what it currently is. I probably am getting in too deep, but I had a theory that the gradient would be different depending on which color model was being used for the original values. To test my theory, I set up a spreadsheet that could interpolate transitional values from two sets of original values. Then, I tried the same calculations on original values of the same colors when expressed in RGB, HSL, LAB, and CMYK. Armed with those new values, I made a graphic test in Designer using the two specimens from your second test. For each case, I put the way it "should" be on top of the way it currently is. Next, I put triangles and lines keyed at the values derived from my spreadsheet. Here is a screenshot of my experiment: What I found was that Affinity currently appears to interpolate in a linear fashion from RGB values (at least in this RGB document). I base that conclusion on the fact that the lines between the triangles keyed at my RGB values are indistinguishable against your specimen of the gradient as it currently is. However, none of the other methods matched your "should be" specimen perfectly, but LAB came close. Do you mind sharing how you created that specimen? (I originally guessed that HSL would give a more "natural" gradation than RGB, but I was quite wrong, and it seems obvious why I was wrong, now that I think about it. Still, it is an interesting effect, as it passes smoothly through the range of hues between two given colors.) gradient interpolations.numbers gradient interpolations.afdesign Quote Link to comment Share on other sites More sharing options...
Jimmini Posted June 18, 2021 Author Share Posted June 18, 2021 Interesting. I'm actually not aware of what the most "correct" color space for interpolation is. LAB does indeed seem to come quite close to linear sRGB in your example, and you can actually use that as your document color space and it will interpolate accordingly. What I was referring to though is that, in sRGB documents, currently colors are interpolated without first applying the inverse sRGB transfer function on the stop colors, which is what I did (abusing one of my own programs) in the examples above. sRGB colors are stored in a non-linear encoding to increase precision for lower (darker) values at the expense of higher ones, as 8 bit integers are not enough otherwise, but those values should never be used for processing if a correct result is expected. I assume the rationale for doing it regardless is to have consistent results in comparison to other software. A gamma setting (like the one for blending layers) could allow both results (approximately). garrettm30 1 Quote Link to comment Share on other sites More sharing options...
garrettm30 Posted June 23, 2021 Share Posted June 23, 2021 This discussion surfaced a consistency issue regarding the interpolation of midpoint colors in gradients depending (or not) on document color space. I posted about it here: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.