Skip to content

Showing points in VoronoiDiagramEffect and CellsEffect#1641

Merged
cameronwhite merged 8 commits into
PintaProject:masterfrom
Lehonti:improvement1
Aug 1, 2025
Merged

Showing points in VoronoiDiagramEffect and CellsEffect#1641
cameronwhite merged 8 commits into
PintaProject:masterfrom
Lehonti:improvement1

Conversation

@Lehonti

@Lehonti Lehonti commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

One can see that the default control points are the same for both effects. Very didactic, in my opinion :)

@Lehonti Lehonti changed the title Showing points in Voronoi diagram Showing points in VoronoiDiagramEffect and CellsEffect Jul 28, 2025
@cameronwhite

Copy link
Copy Markdown
Member

The feature itself looks good, but the alpha handling here seems suspect - writing a ColorBgra with straight alpha into the Cairo surface is definitely incorrect since it expects premultiplied alpha.

Ideally this would work with premultiplied alpha all the way through to avoid future work for #1553 (e.g. ColorBgra.Lerp() can be used for the blending)

@Lehonti

Lehonti commented Jul 31, 2025

Copy link
Copy Markdown
Contributor Author

I have to admit to a bit of ignorance on this; not enough to ignore what premultiplied alpha is, but I would need some focused time to construct my mental models and ensure that I'm blending the colors correctly (and using the right methods, if they exist, or create them if they don't).

For now I just made the points black, and I could handle the blending in a future pull request.

@cameronwhite

Copy link
Copy Markdown
Member

Thanks, that sounds fine for now - I've added a note to #1553 about fixing RandomColorBgra() to create colors with premultiplied alpha which I think is the main issue for these effects, aside from the straightforward changes like replacing color.ToColorBgra() with color.ToColorBgra().ToPremultipliedAlpha() (eventually the conversion should always do this for you)

@cameronwhite cameronwhite merged commit 9777665 into PintaProject:master Aug 1, 2025
6 checks passed
@Lehonti Lehonti deleted the improvement1 branch August 1, 2025 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants