Documentation

Installation

macOS

Download the DMG from the releases page, open it, and drag mlcos-playground.app to your Applications folder.

CLI tools are included in the .tar.gz archive:

tar xzf mlcos-v0.7.3-macos-arm64.tar.gz
sudo mv mlcos-* /usr/local/bin/

Windows

Run the NSIS installer (mlcos-playground-v0.7.3-windows-setup.exe). It installs the CLI tools to %PROGRAMFILES%\mlc-opticscript and adds them to your PATH.

Linux

tar xzf mlcos-v0.7.3-linux-x86_64.tar.gz
sudo mv mlcos-* /usr/local/bin/

Quick Start — Desktop Playground

  1. Launch MLC OpticScript Playground
  2. Drop an image onto the input zone
  3. Select an example from the dropdown — or write your own script
  4. Click Run (or press Ctrl+Enter / Cmd+Enter)

Script Directives

//!OUTPUT: RESULT          // declare output keys
//!INPUT: PHOTO            // declare input slots (creates drop zones)
//!PARAM: ANGLE:number=45  // add parameter slider to the UI

Quick Start — CLI

# Run a JavaScript pipeline
mlcos-run script.js --INPUT=photo.png --OUTPUT=result.png

Quick Start — HTTP Server

mlcos-server -port 8080 -token mysecret
# POST /process with image + script

JavaScript API Overview

// Load and transform
const img = Engine.loadImage("INPUT");
const result = img
  .brightness(1.1)
  .contrast(1.3)
  .blur(1.5)
  .rotate(30)
  .resize(800, 600);
Engine.saveImage(result, "OUTPUT");

// Vector overlay
const canvas = Engine.createCanvas(800, 600);
const path = Engine.createPath()
  .moveTo(100, 100)
  .cubicTo(200, 50, 300, 150, 400, 100)
  .close();
canvas.fill(1, 0, 0, 0.5).drawPath(path);
const overlay = canvas.toImage();
result.blendAt(overlay, 0, 0, { mode: BLEND_OVER });

// SVG tracing
const svg = img.toSVG({ colorCount: 16, pathSimplify: "spline" });
Engine.writeSVG("OUTPUT_SVG", svg);