AGPL-3.0-or-later · forever.

the standard library

nika:image_fx

Apply deterministic artistic effects to a PNG (dither · palette · duotone · pixelate · halftone · grain · vignette · chromatic_aberration · scanlines · glitch · ascii) — byte-identical forever for identical input+args; the recipe rides the artifact (tEXt) and outputs carry path + sha256, bytes never inline. One of 28 builtins in the closed nika: namespace.

the media familyimages, audio, charts: assets, not blobs

  • mediafamily4 tools
  • 4argsdeclared contract
  • 3requiredcheck teaches a miss
  • craftedusage filecheck-green below

the contract

4 args · 3 required

A missing required arg is a nika check finding before anything runs; the vocabulary below comes from the binary itself (nika catalog --tools --json), not from prose.

input*
stringsource PNG path (read · permit-gated fs.read · PNG v1: produce upstream via image_generate format png)
out*
stringoutput artifact path (.png · .txt/.ans for ascii text/ansi emits) — rides the declared permits.fs boundary
ops*
arrayordered single-key op maps · resize{width,height,filter} · crop{x,y,width,height} · levels{brightness,contrast} · grayscale · palette_map{palette} · dither{mode,palette} · duotone{dark,light} · pixelate{block} · halftone{cell,angle} · grain{intensity} · vignette{strength} · chromatic_aberration{shift} · scanlines{strength,period} · glitch{line_shift,channel_shift,blocks} · ascii{cols,emit} (ascii must be last)
seed
integerstochastic-op seed (grain · glitch) · default 0 · the seed IS the style

in a real file

a complete workflow
image_fx.nika.yaml
nika: v1workflow:  id: poster-treatment  description: "deterministic artistic ops over a png — seeded, replayable"permits:  fs:    write: ["./shots/hero-poster.png"]  exec: false  tools: ["nika:image_fx"]tasks:  stylize:    invoke:      tool: "nika:image_fx"      args:        input: "./shots/hero.png"        out: "./shots/hero-poster.png"        ops:          - duotone: {}          - grain: {}        seed: 7  review:    with:      poster: ${{ tasks.stylize.output }}    infer:      model: ollama/llama3.2-vision      prompt: "Poster at ${{ with.poster }} — is the subject still legible after the treatment? One line."      vision:        - { source: file, path: "./shots/hero-poster.png" }      thinking: { enabled: true, budget_tokens: 2000 }outputs:  poster: ${{ tasks.stylize.output }}  verdict: ${{ tasks.review.output }}

a complete file, nika check green; the drift gate re-validates this copy against the schema on every test run. open it in the playground →

cross-references

ships in skeletons

no skeleton ships it; the crafted file above is the reference.

the check gates

the media family

4 tools

images, audio, charts: assets, not blobs.

Machines read the same vocabulary at /tools/catalog.json; the contract lives in spec 06 · stdlib. Install and ask the binary itself: nika catalog --tools. Read the spec →