Skip to content

Releases: Lockyc/plate

v0.6.0

Choose a tag to compare

@Lockyc Lockyc released this 04 Oct 09:17

What's new since v0.5.0

  • plate slides: previews a Google Slides deck from the JSON presentations.get returns, for a deck too large for Drive to export. Takes a file or - for stdin. plate does not call Google's APIs. It writes sNN.html and sNN.png per slide into --out (by default a fresh temporary directory) and prints the PNG paths. --pages takes numbers, ranges and slide object IDs; --scale sets the device scale. Every face the slides name is fetched at the weight Slides draws it, so text wraps where Slides wraps it. Placeholder text takes its style from the layout and master, inherited backgrounds and theme colours resolve, and lines, tables, videos, charts and word art are listed per slide as not drawn.
  • fonts --google FAMILY:WEIGHT:STYLE (repeatable): fetches a face from Google Fonts into plate's cache on first use and embeds it like a file face, and --subset works on it too. This includes the faces Docs and Slides offer outside the public catalogue, such as Calibri and Helvetica Neue. A face Google does not serve, such as Arial, is an error.

v0.5.0

Choose a tag to compare

@Lockyc Lockyc released this 02 Oct 02:23

What's new since v0.4.0

  • render --transparent — with --png, the PNG has an alpha channel and whatever the page leaves transparent (a background: transparent html and body) is alpha 0 instead of white. A render that comes back without alpha fails rather than passing. --transparent without --png is a usage error.
  • fonts --subset latin — cuts each font to Basic Latin, Latin-1 Supplement, common punctuation (U+2010–2027, U+2030–203A) and the euro sign with hb-subset before embedding. Open Sans Regular: the font goes from 147 KB to 33 KB, its CSS from 197 KB to 44 KB. Takes .ttf or .otf input and keeps that format; without the flag, output is unchanged.
  • New engine: hb-subset (HarfBuzz), pinned at a minimum version and checked by plate doctor (brew install harfbuzz, or libharfbuzz-bin on Debian/Ubuntu). Only fonts --subset needs it.

v0.4.0

Choose a tag to compare

@Lockyc Lockyc released this 02 Oct 02:08

Documents and PDFs.

  • plate pdf inspects a PDF. info prints its metadata and whether it has a text layer, text extracts layout-preserved text, pages renders pages to PNG, and images extracts embedded rasters. pages and images print every path they write. They create --out if it is missing and refuse to write into one that already holds a file of the same name. images refuses a PDF with no embedded rasters instead of exiting 0 with nothing written. --dpi is bounded to 1–1200.
  • plate doc renders markdown or HTML to a PDF with a plain document look: A4, a running head taken from the first heading, page numbers, and ruled tables. --css replaces the stylesheet. Relative images resolve next to the input whatever the working directory, and an HTML file's own styles take precedence over the default. Markdown goes through pandoc, which is now checked by plate doctor.
  • Every integer flag is now read in base 10. Before this, --height 0800 was read as octal 512, and --budget 0100 as 64 ms.

v0.3.0

Choose a tag to compare

@Lockyc Lockyc released this 02 Oct 02:02
  • plate render --html out.html: write the page's DOM once its scripts have settled, a static copy with every script's work done. No --size needed. Refuses (exit 1, file removed) a dump that does not end in </html> or that contains a --fail-if string; Chrome's non-zero teardown exit is ignored when the page is complete.
  • Engine: Cmd.AllowExit lets a caller judge an engine's output by content rather than exit status.
  • Output-collision check now covers every pair of --png, --pdf, --html.

v0.2.0

Choose a tag to compare

@Lockyc Lockyc released this 02 Oct 00:44

imgkit is now plate. The module path, binary and every name that carried "imgkit" change in this release; nothing under the old name keeps working.

Moving from imgkit

go install github.com/lockyc/plate@latest
plate doctor --install
  • Binary: imgkit → plate. Remove the old one from your Go bin directory.
  • Policy file: imgkit.toml → plate.toml.
  • Environment: IMGKIT_DEVICE → PLATE_DEVICE, IMGKIT_ENGINE_<NAME> → PLATE_ENGINE_<NAME>.
  • Managed engines and caches: ~/.local/share/imgkit → ~/.local/share/plate, ~/.cache/imgkit → ~/.cache/plate (XDG locations respected). Move them to skip a re-download, or let plate doctor --install fetch again.

Fixes since v0.1.0

  • infill and inpaint refuse a source with transparent pixels, and infill refuses a hole wider than its coarsest level reaches, instead of writing a plausible-looking wrong fill.
  • The synthesis policy is checked at dispatch from the command table, so every pixel-synthesising command honours plate.toml the same way.
  • render and fonts check the page load whose result is kept, and leave no stale CSS behind on failure.
  • press accepts 1-bit stencil masks, no longer fails a CMYK image whose pixel bytes look like an RGB operator, and escapes % in output paths so Ghostscript writes the file you named.
  • A dash-led input or output path is passed to engines as a file, not a flag.
  • Float flags refuse NaN and infinity at parse time.
  • ML scripts and the Vision helper share one content-addressed cache.

v0.1.0

Choose a tag to compare

@Lockyc Lockyc released this 01 Oct 14:51

imgkit is a Go CLI of image and render operations for print and web pipelines. Each command wraps a pinned engine, and its quality is measured against a committed set of test images.

Commands

  • cutout: lifts the subject out of an image as RGBA, down to hair and fur. --coarse vision (Apple Vision) or --coarse birefnet picks the first-pass mask; despill flags remove background colour from edges.
  • inpaint: fills a masked region with LaMa. Creates pixels, so it honours synthesis = "forbid" in imgkit.toml.
  • infill: fills a hole in a flat ground by blending blurred copies of its surroundings, then lays the ground's own grain over it. Honours the synthesis policy.
  • upscale: enlarges 4x with DAT, sharpening what the small image holds rather than inventing texture. Honours the synthesis policy.
  • grade fit: recovers a reference image's colour grade as a lookup table, ignoring excluded regions and requiring a minimum of inlier pixels.
  • grade apply: applies that lookup table, keeping transparency.
  • render: HTML to PNG or PDF with chrome-headless-shell; refuses unverified sizes, stamps print DPI, fails on Letter pages and on --fail-if text.
  • press: converts a PDF to a print master (text as outlines, CMYK colour) and checks it against a soft proof, failing if the result drifts past the thresholds.
  • diff: compares two images after lining them up, so a small shift does not fail everything.
  • fonts: embeds web fonts into a CSS file so a page renders from the filesystem.
  • qr: makes a QR code SVG that any phone camera decodes.
  • doctor: checks every engine against its pin, installs the ones imgkit manages, and prints the install command for the rest.
  • version: prints imgkit's version.

imgkit <command> -h lists each flag with its default.

Getting started

go install github.com/lockyc/imgkit@v0.1.0
imgkit doctor --install

Needs

  • uv for the ML commands (cutout, inpaint, upscale, grade fit). The first run of each downloads its Python dependencies and model weights, several GB on Linux, into the uv, Hugging Face, rembg and PyTorch caches.
  • Every other engine is checked by imgkit doctor.
  • IMGKIT_DEVICE=cpu|mps|cuda chooses the PyTorch device.

Platforms

  • Apple Silicon, macOS 14 or later: every command.
  • Linux, glibc 2.28 or later, x86_64 or arm64: every command except cutout --coarse vision; cutout defaults to --coarse birefnet there. On arm64, render needs a chrome-headless-shell supplied via IMGKIT_ENGINE_CHROME_HEADLESS_SHELL. render also needs the usual Chrome shared libraries (such as libnss3) from the distribution; doctor does not check for them yet.
  • Intel Macs: the torch-backed commands (cutout, upscale) refuse to run; grade fit needs macOS 14 or later; inpaint is untested.

The quality cases were measured on Apple Silicon (MPS).