ditherInks

A dither filter: colors the 0/1 levels from quantise, either with two colors of your own or with darkened and brightened versions of the layer's own pixels.

ditherInks(slots: {
    grid: PixelGrid
    levels: GatherStage
    mode: PropRef
    colors: [PropRef, PropRef]
}): GatherEffect

Import patterns from shaders/std and use patterns.ditherInks.

Goes in effect:. mode is a compileTime: true select prop, 'custom' or 'source'. colors is [dark, light] for custom mode; a transparent dark color lets the background show through.

Parameters

NameTypeNotes
slots`{
grid: PixelGrid
levels: GatherStage
mode: PropRef
colors: [PropRef, PropRef]

}` | |

Example

effect: ditherInks({grid, levels: quantise({grid, pattern: p('pattern'), threshold: p('threshold'), spread: p('spread')}), mode: p('colorMode'), colors: [p('colorA'), p('colorB')]})

See also

  • pixelGrid — The pixel grid of a dither: the layer inside it chopped into square cells of a given size.
  • quantise — Reduces each grid cell of the layer inside to 0 or 1 using a dither pattern.
  • dotScreen — A classic halftone filter: the layer inside it redrawn as a grid of dots that grow where it is bright.

Used by

Dither