Skip to content

Pixelate effect#341

Merged
bobnik merged 3 commits intomasterfrom
feature/pixelate
Mar 20, 2026
Merged

Pixelate effect#341
bobnik merged 3 commits intomasterfrom
feature/pixelate

Conversation

@bobnik
Copy link
Copy Markdown
Collaborator

@bobnik bobnik commented Jan 23, 2026

Pixelate effect

Summary

Adds a new Pixelate effect that transforms any shape into a blocky, pixel-art style outline. It can handle both solid shapes (like stars, hearts) and line-based patterns (like mazes, wipers).

image image

Test Plan

  • Apply to solid shapes (Star, Heart, Circle) - should pixelate the filled area
  • Apply to line shapes (Wiper, Maze) - should pixelate the stroke path
  • Adjust pixel size slider - verify smooth transitions

@jeffeb3
Copy link
Copy Markdown
Owner

jeffeb3 commented Feb 24, 2026

This is a good idea. I like the feel of it afterward. It is a nice change to the smooth lines most of the patterns/effects have.

Why does it have to reorder the vertices? I think actually drawing this on a table would be weird.
Screenshot From 2026-02-24 11-27-51

vs.

Screenshot From 2026-02-24 11-28-00

@bobnik
Copy link
Copy Markdown
Collaborator Author

bobnik commented Mar 15, 2026

Why does it have to reorder the vertices? I think actually drawing this on a table would be weird.

Unfortunately, the pixelation algorithm isn't really just making a curved line jagged. It's working off of a determination of "is this cell occupied or not" and then walking the shortest path. I see what you mean about it being unintuitive, but I don't think there's a way to preserve path order.

@jeffeb3
Copy link
Copy Markdown
Owner

jeffeb3 commented Mar 18, 2026

I'm fine merging as-is then. I'm not sure I'll ever use it on a table if it goes in a non-deterministic way through the vertices. But I don't use every pattern or effect. It will be interesting to see what happens from it.

I'm curious to know if there is a way to just subsample the existing vertices, then round them to nearby pixels, then reconnect them instead. Maybe the reason why that doesn't work is something I don't understand. Maybe because multiple paths would end up along the same path? Seems interesting to me.

@bobnik
Copy link
Copy Markdown
Collaborator Author

bobnik commented Mar 20, 2026

I'm curious to know if there is a way to just subsample the existing vertices, then round them to nearby pixels, then reconnect them instead. Maybe the reason why that doesn't work is something I don't understand. Maybe because multiple paths would end up along the same path? Seems interesting to me.

It does a pretty good job of tracing the drawn path for many shapes. It looks like tight loops aren't handled well, though. I'm going to go ahead and merge and maybe we can improve later.

@bobnik bobnik merged commit bceef99 into master Mar 20, 2026
2 checks passed
@bobnik bobnik deleted the feature/pixelate branch March 20, 2026 20:07
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