Back to Node List

Path Stroke

path_stroke

Draw a pixel-perfect line along a bezier path as an image and surface

Reviewed
Guide available
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
パス
path
Path
Required
描画するベジェパス
color
Color
線の色(接続時はパラメータより優先)
塗り色
fill_color
Color
閉じパスの塗り色(接続時はパラメータより優先)

Output Ports

NameTypeDescription
画像
output
Image
生成されたパスストローク画像
ピクセル線
pixel_line
PixelLine
太さに関係なく出力するラスタライズ済み中心線座標(下流のピクセル処理用)
サーフェース
surface
Surface
描画した線に高さ・素材ID・面IDを付けたサーフェースです

Parameters

NameTypeDefaultRangeDescription / Options
width
Int
641–1024

キャンバスの幅(ピクセル)

高さ
height
Int
641–1024

キャンバスの高さ(ピクセル)

対象サブパス
sub_path_scope
Enum
All

すべてのサブパスを描画するか、1 本だけ描画するかを選びます

  • すべてAll
    すべてのサブパスを描画します
  • 個別Single
    選んだ 1 本のサブパスだけを描画します
使うサブパス
sub_path_index
Int
00–255

個別モード時に使うサブパスを選びます

太さ
thickness
Int
11–64

線の太さ(ピクセル)

終端の太さ
end_thickness
Int
00–64

テーパー(先細り/先太り): 線の終わりの太さです。0なら全体が「太さ」のまま均一。太さ3→終端1のようにすると草・毛・尻尾・炎の先細りの線になります

color
Color
[1,1,1,1]

線の色(入力ポート未接続時に使用)

ピクセルパーフェクト
pixel_perfect
Bool
true

L字ダブリを除去してきれいな1pxラインに補正(太さ=1のみ)

PP モード
pp_mode
Enum
RemoveCorner

ピクセルパーフェクト補正でどちらの冗長ピクセルを削除するか

  • 対角優先Diagonal
    水平ステップを削除してより対角的なラインに
  • 直線優先Cardinal
    垂直ステップを削除してより水平/垂直的なラインに
  • 角削除(対称)RemoveCorner
    常に角ピクセルBを削除(ミラー対称保証)
  • 角保持(対称)KeepCorner
    常に角ピクセルBを保持(ミラー対称保証)
閉パス外積モード
pp_closed_cross
Bool
false

閉じたサブパスに外積ベースの内/外エッジ削除を適用

閉パス削除側
pp_closed_side
Enum
Outer

閉パスのどちら側のエッジを削除するか

  • 内側Inner
    内側のエッジを削除
  • 外側Outer
    外側のエッジを削除
閉パス塗りつぶし
fill_closed
Bool
false

閉じたサブパスの内部を塗りつぶす

塗り色
fill_color
Color
[1,1,1,1]

閉パスの塗り色(入力ポート未接続時に使用)

素材ID
material_id
Text
core:default

サーフェース出力で、線や塗りがあるピクセルに付ける素材です

面ID
face_id
Text
surface:path-stroke

サーフェース出力で、線や塗りがどの面に属するかを示すIDです

面の高さ
surface_height
Float
0.550–1 / step 0.01

線や塗り部分の高さです。大きいほど出っ張った面として扱います

くぼみの暗さ
surface_ao
Float
0.960–1 / step 0.01

線や塗り部分の暗さです。小さいほどくぼんだように暗くなります

ざらつき
surface_roughness
Float
0.750–1 / step 0.01

光を当てた時の質感です。大きいほどつやが弱い面になります

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 with pp_mode: Diagonal for more diagonal lines, Cardinal for more horizontal/vertical lines, or the default RemoveCorner when unsure.
  • Turn fill_closed ON 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 color input 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_perfect works 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_path editor; fill_closed applies 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 = Single and choose with sub_path_index.

Drawing algorithm

thickness = 1 (pixel-perfect mode)

  1. Sample each segment with rasterize_bezier_segment() and convert it to pixel coordinates.
    • Skip endpoints on .5 boundaries to prevent protrusion from round().
  2. Merge coordinates from every segment and remove duplicates at joins.
  3. Restore corner pixels at joins: when a diagonal gap is detected at a .5,.5 anchor, 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.
  4. For a closed path, connect the end to the start with Bresenham.
  5. Guarantee eight-direction connectivity with ensure_8connected().
  6. If pixel_perfect is enabled, remove duplicate L-shapes with PP correction.
  7. For a closed path, apply wraparound L-shape correction.
  8. 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_perfect correction applies only when thickness = 1.
  • pp_mode, pp_closed_cross, and pp_closed_side appear only at thickness 1.
  • pixel_line is 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,.5 anchors is handled automatically inside rasterize_subpath.
  • sub_path_index appears only when sub_path_scope = Single.
  • The upper limit of sub_path_index updates in the UI to match the number of input subpaths.

Related nodes

  • bezier_path / multi_path_editor — create the source path
  • path_fill — when only the fill is needed
  • pixel_line — draw from an explicit pixel-coordinate sequence
  • outline — add an outline afterward to a finished image
Back to Node List
Path Stroke — PixPipeline Node Reference