HaikuArchives / ArtPaint

ArtPaint is a painting and image processing program.
https://haikuarchives.github.io/ArtPaint/
29 stars 18 forks source link

Antialias cone gradients #572

Open humdingerb opened 1 year ago

humdingerb commented 1 year ago

Conic gradients would look nicer if the border where colour 2 (white) encounters colour 1 (blue) again. See this zoomed-in example:

cone

dsizzle commented 1 year ago

I was going to say that the use-cases I’ve seen would mostly be where the start and end color are the same. However, recently I saw where people make purposely hard edged conic gradients for things like pie charts. For that you’d want any hard edge to be antialiased.

Not sure how hard it is to do, maybe if the previous pixel differs by more than a certain amount, add a pixel with a color halfway between? Or the average of the pixel to the left and above?

humdingerb commented 1 year ago

I was going to say that the use-cases I’ve seen would mostly be where the start and end color are the same.

You mean doing the cone like WonderBrush:

WBconic

That would solve our issue. Removes some artsy potential though...

dsizzle commented 1 year ago

no, that seems like it reverses the colors halfway thru - I mean once ArtPaint allows setting more colors in the gradient, the user would manually set the start and end to the same. That's the use case I'm most familiar with. For drawing stuff such as:

ax-anisotropic-brushed-pot

humdingerb commented 1 year ago

Right. It's more flexible (once more than two colours are possible), but needs to have the problem solved of antialiasing a hard colour switch, if the user sets the start and end colours to (very) different colours.