Flow Brush Painter - Overview

What It Does

Flow Brush Painter is a sophisticated painterly effect spoke that analyzes your image's structure and creates brush strokes that follow the natural contours, edges, and flow patterns within the image. Using structure tensor analysis, it calculates gradient directions across the image and paints strokes that align with these flows, creating artistic effects ranging from impressionistic to highly stylized.

Core Concept: Structure Tensor Flow

The spoke calculates a flow field from your image by:

  1. Computing image gradients (changes in brightness/color)
  2. Creating a structure tensor at each pixel
  3. Applying Gaussian smoothing to the tensor (controlled by "Tensor Flow Smoothing")
  4. Determining the principal direction at each point

This flow field guides every brush stroke, ensuring they follow edges, curves, and natural image features rather than being randomly oriented.

Brush System

Algorithmic Brushes (8 Built-in Styles)

  • Feathered - Soft-edged elliptical brush with gradient falloff (similar to Random Painter)
  • Fluid - Rounded line with caps, smooth and organic
  • Angular - Hard-edged rectangular knife stroke
  • Diamond - Tapered four-point shape
  • Wedge - One-sided tapered stroke
  • Arrowhead - Chevron/pointed shape
  • Teardrop - Raindrop form with rounded back, pointed tip
  • Hourglass - Bowtie shape with narrow waist

PNG Brush Support

Load any PNG image as a custom brush via the "LOAD PNG BRUSH" button. The PNG's transparency defines the brush shape, and it will:

  • Automatically color-match to sample colors from your image
  • Scale according to Thickness and Length controls
  • Rotate to follow the flow field
  • Override the dropdown selection when loaded

Painting Modes

Auto-Painting Mode

START PAINTING / STOP PAINTING buttons

Continuously applies strokes across the entire image:

  • Random position sampling
  • Flow-aligned orientation
  • Color sampled from original image at stroke location
  • Speed controlled by "Paint Speed" slider (1-800 strokes/frame)
  • Runs until stopped, building up layers of painterly texture

Manual Painting Mode

Interactive brush cursor follows your mouse:

  • Left-click + drag - Paint strokes following flow
  • Right-click + drag - Erase with soft feathered brush
  • Cursor size shows paint area
  • Multiple strokes painted within cursor area each frame
  • Density controlled by "Paint Density" slider

Cursor indicators:

  • Green border = Paint mode
  • Red border = Erase mode

Key Controls

Brush Shape & Size

  • Stroke Scale (0.1-3.0) - Master size multiplier for both thickness and length
  • Thickness (0.5-25) - Brush width perpendicular to flow
  • Length (1-100) - Brush stroke length along flow direction
  • Variation (0-100%) - Randomizes both size and opacity for natural variation

Color & Appearance

  • Effect Opacity (0-100%) - Transparency of painted layer over original
  • Automatic color sampling from original image
  • Built-in HSL saturation variation (±15%) for color richness
  • Opacity variation tied to Variation slider

Flow Field Analysis

  • Tensor Flow Smoothing (0-50) - Gaussian blur radius for structure tensor
    • Lower values = follows fine details closely
    • Higher values = creates broader, flowing contours
    • Recalculates flow field 300ms after adjustment

Manual Brush Controls

  • Cursor Size (5-150) - Diameter of paint/erase area
  • Paint Density (1-20) - Number of strokes per cursor position
  • Fixed 2% erase strength for gradual erasing

Canvas Background

Two modes toggle which background shows while painting:

  • WHITE CANVAS (default) - Paint on pure white, easier to see brush effects
  • ON IMAGE - Paint directly over original image

Both modes maintain the original image data for "View Original" and final compositing.

Workflow Pattern

Typical Usage

  1. Image loads (from hub or Open Image button)
  2. Structure tensor calculates - flow field ready
  3. Adjust Tensor Flow Smoothing - preview updates, flow recalculates
  4. Choose brush style - preview shows current brush
  5. Set size/variation/opacity - preview updates in real-time
  6. Choose painting mode:
    • Auto: START PAINTING and watch it build up
    • Manual: Click and drag to paint/erase interactively
  7. Adjust Effect Opacity - blend result with original
  8. SEND BACK TO EDITOR - composites and returns to hub

Additional Actions

  • VIEW ORIGINAL - Hold mouse button to temporarily show original (opacity 0)
  • CLEAR CANVAS - Reset to current background mode (white or image)
  • SAVE IMAGE - Download composite as PNG
  • OPEN IMAGE - Load standalone image file

Brush Preview

Real-time preview canvas shows:

  • Current brush shape (horizontal orientation)
  • Current Thickness and Length settings
  • Current Stroke Scale applied
  • Updates when any relevant control changes
  • Preview for PNG brushes too (colored dark gray)

Design Philosophy

Unlike random scatter painters, Flow Brush respects image structure. Every stroke is oriented and positioned according to the underlying visual flow, creating results that feel coherent with the image's form while maintaining painterly looseness through variation controls.

The combination of precise flow-following and controlled randomness (via Variation slider) produces effects that range from tight, contour-following illustrations to loose, impressionistic paintings - all while maintaining visual coherence with the original image's structure.