Examples

Montage grid of effect variants

Generates a 3x3 contact sheet from a single input image by applying various effects (grayscale, sepia, invert, etc.

Dimension-aware centre crop to square

Automatically detects image dimensions and applies a centered square crop.

Face detect → blur or magnify per face (rect / circle / ring marker)

Detects faces with an on-device AI model and either blurs them (privacy) or magnifies them (lupe / spotlight).

Face detect → side gallery (per-face thumbs + arrows + labels)

Detects every face, then extends the canvas to the right and pastes a circular thumb of each face stacked vertically.

Gaussian blur (adjustable sigma)

Applies a Gaussian blur effect to an image with a customizable sigma parameter for controlling the blur intensity.

Increase brightness

Adjusts the brightness of an image by a specified factor.

Math-driven animation — trig-parameterised hue / swirl / sat / vignette

Renders a full WebP/APNG animation where every frame's hue, swirl, saturation and vignette are functions of t ∈ [0, 1).

Painterly look that follows image structure — anisotropic Kuwahara

`img.

Autocrop — trim a transparent or solid-colour border

Finds the smallest rectangle that still contains the actual content and crops to it.

3-D bar chart with stair-stepped Z-axis

Drives the `barchart3d` engine extension.

5 portraits placed along a cubic Bézier curve

Demonstrates placing multiple images tangent-aligned along a cubic Bézier curve.

3 portraits placed along a cubic Bézier curve, sliced

An advanced version of the Bézier placement demo that slices each image into vertical strips and warps them individually.

Wrap an image along a curve — Bézier or figure-8

The portrait is laid out as a long row of copies and bent

Three blur flavours — Gaussian, anisotropic, motion

Same image through three different blur kernels stacked

Color match — paint one photo with another's mood

Picks up the colour mood of a reference photo and paints it onto your target.

Side-by-side before / after comparison panel

Creates a side-by-side comparison of two images with color-coded label bars and a vertical divider.

Custom convolution kernels — sharpen, emboss, edge-detect, motion blur

Demonstrates the power of custom convolution kernels by creating a side-by-side showcase of sharpening, embossing, edge detection, and motion blur effects.

Crossfade — animated A → B transition in N steps

Smooth fade between two photos, exported as an animated WebP that

3-D cube with image-stamped faces and wireframe overlay

Projects a 3D cube onto a 2D canvas, applying a source image to each visible face with realistic Lambertian shading and a vector wireframe overlay.

3-D cube — different image per visible face (front, right, top)

A variation of the 3D cube demo that maps three different input images to the visible faces (front, right, and top).

Poster-art look — flat colour blocks with crisp ink outlines

Turns any photo into a graphic-novel / silk-screen poster: the image collapses into a small palette of flat colour fields, then sharp black outlines on top…

Image degradation pipeline — synthesise training data for restoration models

The Real-ESRGAN / GFPGAN "high-order degradation model": take a pristine image and synthesise the damage real-world low-quality photos carry, so a restoration…

Delaunay shatter — triangulate and rotate every tile

Pick the four image corners plus `POINTS` random interior points,

Four-way denoise comparison — noisy / median / bilateral / NLM

Adds synthetic noise to the input, then runs three different

Rotating cylinder drum with image panels

Simulates a rotating cylindrical drum with multiple image panels.

Typography specs — Engine.useFont, multi-line, word-wrap, textAlign

Hero composition over any photo: title + subtitle + body paragraph

Halftone screen — newspaper-style dot pattern

Render the source through a rotated dot grid in the style of an

Halo + drop-shadow workflow on a transparent silhouette

Adds a coloured halo and a soft drop-shadow behind any subject

Hockney / Picasso joiner — cubist photo collage

Fragments the photo into N random rectangles, rotates each a few degrees, drops a shadow under it, and composites the lot back at roughly-but-not-quite the…

Oil-paint look via Kuwahara — one call

`img.

3-D line chart with extruded ribbon bands

Sister to demo_barchart3d: same input shape (categories × series) but the values along X are connected as a line, and each series is extruded along Z into a…

Mandelbrot set — interactive zoom

Bellard's QuickJS mandelbrot demo, ported from ANSI-coloured terminal blocks to a real ImageHandle.

Matrix toolbox — Mat3 / Mat4 storage layout, drawn as documentation

Visual reference for the built-in `Matrix` toolbox.

EXIF + opticscript.* metadata painted as image overlay

Loads a photo, reads everything Engine.

CSS named colors — NamedColor.tomato, fromName, closestName

Shows the three ways the engine surfaces CSS Color Module Level 4 named colors: the `NamedColor.

Noise explorer — gaussian / uniform / poisson, side by side, live

Interactive comparison of the native addNoise op's three distributions.

Oil-painting / impressionist look — without a Kuwahara filter

Approximates a painted look from existing engine ops alone — no Kuwahara, no neural net.

Phase 1 atomic ops — differenceMap + orientationField

Visualises the two atomic ops that anchor the Hertzmann painterly

Pencil sketch — soft graphite via colour-dodge

`img.

Live console + progress bars — Engine.log + Engine.progress

Stream log lines and progress bars to the UI / CLI **while the

Progressive multi-pass sharpening — every stage visible

Runs 4 sharpen+soften passes with increasing sharpness each

Image-as-jigsaw — slice along bezier puzzle cuts

Turns any photo into a classic jigsaw puzzle layout.

QR code with a centred brand logo

QR codes carry built-in Reed-Solomon error correction.

Hand-drawn bar chart over a photo (mlcrough + image)

Hand-drawn 3-D bar chart laid over a photo background — the sketchy aesthetic that turns dry numbers into something people actually look at.

Hand-drawn pie chart (mlcrough renderer API)

Drives the `mlcrough` engine extension via Engine.

Hand-drawn 3-D pie chart (mlcrough renderer API)

Drives the `mlcrough` engine extension via Engine.

Shadow / highlight recovery — before / after comparison

Showcases the shadow and highlight recovery filters with a three-panel comparison — original, shadow lifting, and combined shadow/highlight adjustment.

Shatter cuts — cracked-glass effect with three sliders

Cracked-glass effect that drops onto any photo: the script slices

Circular logo badge via SVG Canvas

Composed logo demonstrating Engine.

SVG Canvas — vector drawing that emits SVG

Showcase of Engine.

Load SVG, apply effects, save as PNG

Demonstrates importing an SVG string, rasterizing it at high resolution, and applying post-processing effects like blur and vignette.

Spirograph (hypotrochoid) via SVG Canvas

Parametric hypotrochoid drawn as one long polyline onto an SVG canvas, then rendered with neon-glow layered strokes (four successively thinner strokes, each…

Text overlay — watermark, tech strip, caption

Drops watermark, EXIF-style metadata, timestamp, and a centred caption onto a photograph using the engine's two embedded fonts (Inter sans-serif, JetBrains…

Web-ready thumbnail set — one image, three responsive sizes

Generates 320 / 640 / 1280 px WebP variants from a single source — the same pipeline mlcgo.

Three simultaneous outputs: BW, warm, cool

Demonstrates how to generate multiple output images from a single input in one script execution.

Turn a photo into an SVG vector graphic

Automatically traces a photograph into a scalable SVG, ready for logos, prints or any size you need without quality loss.

Artistic effects: sepia + vignette

Applies a combination of sepia tone and vignette to create an artistic, vintage photograph look.

Convert to greyscale

Simple conversion of a color image to grayscale.

Invert all channels

Inverts the colors of an image, creating a negative effect.

Multi-op pipeline: colour grading, sharpen, resize

Demonstrates a comprehensive image processing pipeline combining color grading, sharpening, blurring, and resizing in a single chain.

Resize to 200×200 (bilinear)

Simple bilinear resizing of an image to a fixed 200x200 resolution.

Strip a white background from sketches and line art

Turns the white (or near-white) paper around a drawing into transparency, in one fast pass.

Stamp images at perspective quads (stampAt)

Demonstrates the stampAt helper by placing multiple copies of an image onto a background using 4-point perspective quadrilaterals, allowing for skew and…

AI denoising — sensor noise removal via DRUNet

Removes sensor noise from photos without the muddy "AI-smoothed" look — fine texture (hair, fabric, foliage) survives.

Tool plugin — full face restoration pipeline (detect + align + restore + blend)

Replicates the Q-engineering GFPGAN-ncnn pipeline using OpticScript's native ops for everything except the two ML steps.

Tool plugin — face detect & pixelate (Pigo, pure Go)

Demonstrates a pure-Go Tool Plugin built on Pigo (Pico cascade).

Tool plugin demo — wraps the input image in a coloured frame

Demonstrates a single-input Tool Plugin.

AI-driven background removal — isolate the subject

Cuts the background out of any photo and keeps just the foreground subject — works on portraits, products, animals.

Cylindrical half-pipe warp (inverse projection)

Mathematically generates a warp grid that simulates an inverse cylindrical projection, creating a 'half-pipe' visual effect where the image appears to curve…

Hourglass pinch: columns squeezed at vertical centre

Creates an hourglass-shaped distortion by squeezing the horizontal columns toward the center as they approach the vertical midpoint of the image.

Animated montage — 4 effects fly in

One source image, four effect variants (grayscale, sepia, blur, threshold), each flying in from a different edge to land in its 2×2 quadrant.

Animation demo — 1-second fade-in of an image

Demonstrates how to create a simple fade-in animation by iteratively adjusting the brightness of a source image and adding frames to an animation container.

Animation demo — slide-in of an overlay image over a background.

Demonstrates a two-layer animation where an overlay image slides into the frame from the left over a background image.