Overview
A rasterizer that turns a path into a pixel line resembling hand-placed pixels. It draws along a Bézier path and, by default, produces a pixel-perfect 1px line with extra L-shaped pixels removed. This is the most basic exit from a PixPipeline path into pixel art.
- Version: 2
- Generator: yes (
is_generator: true— eligible for automatic canvas-size binding)
Usage tips
- The basic chain is
bezier_path → path_stroke → blend. Start with thickness 1 and pixel-perfect ON, then tune line character withpp_mode:Diagonalfor more diagonal lines,Cardinalfor more horizontal/vertical lines, or the defaultRemoveCornerwhen unsure. - Turn
fill_closedON to fill a closed shape as well. Line and fill may use separate colors, completing the pixel-art outline + interior idiom in one node. - Connect the
colorinput to manage line color through a palette or variable. - Taper: set End Thickness to 1+ and the width blends from Thickness at the start to that value at the end. 3 down to 1 gives the classic grass / fur / tail / flame stroke (0 keeps the stroke uniform).
- Match canvas dimensions with the path source such as
bezier_path. Both use canvas binding by default, so they normally align automatically.
Common pitfalls
- The line character changes at thickness 2 or more:
pixel_perfectworks only at thickness 1. Thick strokes apply a circular brush to the same centerline; even widths use a half-pixel right/down bias so the cross-section matches the requested width. - Fill has no effect: the path is open. Close it in the
bezier_patheditor;fill_closedapplies only to closed subpaths. - Nothing appears: an unconnected path intentionally outputs a transparent image. Check the path input.
- Every path appears when only part of a multi-path is needed: set
sub_path_scope = Singleand choose withsub_path_index.
Drawing algorithm
thickness = 1 (pixel-perfect mode)
- Sample each segment with
rasterize_bezier_segment()and convert it to pixel coordinates.- Skip endpoints on
.5boundaries to prevent protrusion fromround().
- Skip endpoints on
- Merge coordinates from every segment and remove duplicates at joins.
- Restore corner pixels at joins: when a diagonal gap is detected at a
.5,.5anchor, insert a corner pixel to prevent missing corners on squares and similar shapes. Do not insert one at non-right-angle vertices such as triangles. - For a closed path, connect the end to the start with Bresenham.
- Guarantee eight-direction connectivity with
ensure_8connected(). - If
pixel_perfectis enabled, remove duplicate L-shapes with PP correction. - For a closed path, apply wraparound L-shape correction.
- Draw the resulting pixel coordinates into the image.
thickness ≥ 2
Adaptively flatten the curve into an eight-connected centerline, then stamp a circular
brush at each point. Even widths use a half-pixel right/down bias, so horizontal and
vertical cross-sections match thickness. pixel_line outputs this source centerline
for every thickness.
fill_closed = true
Scanline-fill closed subpaths beneath the stroke. At thickness=1, the PP-corrected coordinate sequence is used as the polygon.
Examples
Basic path drawing
[BezierPath] → path → [PathStroke] → output → [Preview]
Colored path
[ColorRGB] → color → [PathStroke] → output → [Blend] → [Preview]
↑
[BezierPath]
Drawing only one path from a multipath
[MultiPath] → path → [PathStroke(sub_path_scope:Single, sub_path_index:1)] → [Preview]
Downstream processing of pixel coordinates
[BezierPath] → path → [PathStroke] → pixel_line → [PixelLineNode]
Using it as a Surface
[BezierPath] → path → [PathStroke] → surface → [Surface Light Preview]
With fill_closed on, the closed interior is treated as part of the same Surface as
the line.
Notes
pixel_perfectcorrection applies only when thickness = 1.pp_mode,pp_closed_cross, andpp_closed_sideappear only at thickness 1.pixel_lineis always the rasterized centerline before the thickness brush is applied.- An unconnected path outputs an empty transparent image.
- An unconnected path also returns an empty image and empty Surface.
- Surface parameters are collapsed under "Surface" in the inspector.
- Because
is_generator: true, the node participates in canvas-size binding. - Corner-pixel restoration at
.5,.5anchors is handled automatically insiderasterize_subpath. sub_path_indexappears only whensub_path_scope = Single.- The upper limit of
sub_path_indexupdates in the UI to match the number of input subpaths.
Related nodes
bezier_path/multi_path_editor— create the source pathpath_fill— when only the fill is neededpixel_line— draw from an explicit pixel-coordinate sequenceoutline— add an outline afterward to a finished image