Skip to content

Part of gap 2: Effect › Pixelate (Color Halftone, Crystallize, Mezzotint, Pointillize) - #930

Merged
bflatastic merged 1 commit into
mainfrom
feat/pixelate-effects
Oct 10, 2026
Merged

bflatastic merged 1 commit into
mainfrom
feat/pixelate-effects

Conversation

@bflatastic

Copy link
Copy Markdown
Member

Part of ROADMAP gap 2 (Photoshop-style raster effects).

Adds Effect › Pixelate to the pixel-filter pipeline, with the parameters, ranges and defaults Illustrator's effects summary documents:

  • Color Halftone (pixelate.colorHalftone): Max. Radius 4–127 (8) and Channel 1–4 screen angles −360–360 (108, 162, 90, 45). Each channel is screened at its angle in square cells, each dot covering the share of its cell equal to the channel's mean there, so white stays white and black stays black. RGB documents screen R, G and B; CMYK documents screen C, M, Y and K, also when drawn ink plane by ink plane.
  • Crystallize (pixelate.crystallize): Cell Size 3–300 (10). Polygons of solid colour around one random point per cell.
  • Mezzotint (pixelate.mezzotint): Type (Fine, Medium, Grainy and Coarse Dots; Short, Medium and Long Lines; Short, Medium and Long Strokes) as a dropdown. Each colour channel is turned fully on or off against its own pattern.
  • Pointillize (pixelate.pointillize): Cell Size 3–300 (5). A dot of random size and stacking order per cell, coloured by the softened object, on a white canvas where the object is.

Patterns are laid out in document space around the object, so a result is the same at any zoom or export resolution, moves with the object and is identical on every redraw. Parameters are clamped and checked for finite values, and the work per pixel is bounded (0.2–0.7 s on a 2000 × 2000 raster, within the existing filters' range). PixelSpace gains a channels field that the renderer sets from the ink plane and the document's colour mode.

Menu (Raster Effects section, between Blur and Sharpen), effect dialogs (the Mezzotint Type dropdown, Max. Radius, Channel 1–4 and Cell Size labels), translations in every catalogue, and ROADMAP (raster effects 25% → 28%, ~47 filters left).

References: https://helpx.adobe.com/illustrator/using/summary-effects.html, https://helpx.adobe.com/photoshop/using/filter-effects-reference.html

Tested:

  • cargo xtask ci (all 7 steps).
  • New tests: parameter defaults and clamping, halftone tone and coverage, CMYK and ink planes, crystals, Mezzotint's ten distinct patterns, Pointillize's canvas, and the same result at 2× resolution and when moved. Engine tests_rasterfilters covers the four on the canvas, multithreaded, in PDF and SVG; command_sweep sends them junk parameters.
  • Live over MCP: each effect applied to a gradient-filled ellipse and exported at 144 ppi renders as described.

🤖 Generated with Claude Code

…int, Pointillize)

Four Photoshop-style raster effects on the pixel-filter pipeline
(vectorcraft_effects::pixel::pixelate), under a new Effect › Pixelate
submenu between Blur and Sharpen in the Raster Effects section:

- Color Halftone (maxRadius 4..127, default 8; channel1..channel4 screen
  angles -360..360, defaults 108/162/90/45): each colour channel is
  screened at its angle in square cells sized so a dot of Max. Radius
  fills one; each cell's dot covers the share of the cell that is the
  channel's coverage-weighted mean there (white stays white, black
  black). RGB documents screen R, G, B (channels 1 to 3); CMYK documents
  screen C, M, Y, K inks (channels 1 to 4), also when they are drawn ink
  plane by ink plane (the K plane uses channel 4).
- Crystallize (cellSize 3..300, default 10): every pixel takes the
  colour at the nearest of one jittered point per cell (exact Voronoi
  over a 5 x 5 neighbourhood, pruned by distance).
- Mezzotint (type: Fine/Medium/Grainy/Coarse Dots, Short/Medium/Long
  Lines, Short/Medium/Long Strokes; default Fine Dots; a dropdown in the
  dialog): each channel is turned fully on or off against its own random
  threshold pattern, so the object becomes pure colours.
- Pointillize (cellSize 3..300, default 5): one dot of random size per
  cell at a jittered point, coloured by the softened object there and as
  opaque as the object at its centre, stacked in random order over a
  white canvas where the object is.

Lengths are in points (Scale Strokes & Effects scales them) and every
pattern lies in document space around the object's centre, so the
result is the same at any zoom or raster resolution, moves with the
object, and is identical on every redraw (hash noise of the pattern's
cell indices, no state). Work per pixel is bounded whatever the
parameters, which are clamped to their ranges and finite-checked; the
halftone's cell grid is capped by the raster's size and a screen finer
than 3 pixels leaves the image as it is (its average). PixelSpace gains
`channels` so the renderer tells the filters what the channels hold.

Catalogue rows with parameter docs, outsets and reaches for cropping,
menu entries, dialog labels (Max. Radius, Channel 1-4, Cell Size), the
Mezzotint Type dropdown, translations, and tests: parameters and
clamping, tone and coverage, CMYK inks, polygon crystals, pure-colour
mezzotints with ten distinct patterns, dots on a white canvas, the same
result at twice the resolution and when moved, the canvas, PDF and SVG
through the engine, the command sweep with junk parameters, the dialogs
and the menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bflatastic
bflatastic merged commit 04eb5e5 into main Oct 10, 2026
1 check passed
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.

1 participant