Releases: Lockyc/plate
Releases · Lockyc/plate
Release list
v0.6.0
What's new since v0.5.0
plate slides: previews a Google Slides deck from the JSONpresentations.getreturns, for a deck too large for Drive to export. Takes a file or-for stdin. plate does not call Google's APIs. It writessNN.htmlandsNN.pngper slide into--out(by default a fresh temporary directory) and prints the PNG paths.--pagestakes numbers, ranges and slide object IDs;--scalesets 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--subsetworks 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
What's new since v0.4.0
render --transparent— with--png, the PNG has an alpha channel and whatever the page leaves transparent (abackground: transparenthtml and body) is alpha 0 instead of white. A render that comes back without alpha fails rather than passing.--transparentwithout--pngis 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.ttfor.otfinput 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, orlibharfbuzz-binon Debian/Ubuntu). Onlyfonts --subsetneeds it.
v0.4.0
Documents and PDFs.
plate pdfinspects a PDF.infoprints its metadata and whether it has a text layer,textextracts layout-preserved text,pagesrenders pages to PNG, andimagesextracts embedded rasters.pagesandimagesprint every path they write. They create--outif it is missing and refuse to write into one that already holds a file of the same name.imagesrefuses a PDF with no embedded rasters instead of exiting 0 with nothing written.--dpiis bounded to 1–1200.plate docrenders 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.--cssreplaces 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 byplate doctor.- Every integer flag is now read in base 10. Before this,
--height 0800was read as octal 512, and--budget 0100as 64 ms.
v0.3.0
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--sizeneeded. Refuses (exit 1, file removed) a dump that does not end in</html>or that contains a--fail-ifstring; Chrome's non-zero teardown exit is ignored when the page is complete.- Engine:
Cmd.AllowExitlets 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
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 letplate doctor --installfetch again.
Fixes since v0.1.0
infillandinpaintrefuse a source with transparent pixels, andinfillrefuses 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.tomlthe same way. renderandfontscheck the page load whose result is kept, and leave no stale CSS behind on failure.pressaccepts 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
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 birefnetpicks the first-pass mask; despill flags remove background colour from edges.inpaint: fills a masked region with LaMa. Creates pixels, so it honourssynthesis = "forbid"inimgkit.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-iftext.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 --installNeeds
uvfor 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|cudachooses 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;cutoutdefaults to--coarse birefnetthere. On arm64,renderneeds a chrome-headless-shell supplied viaIMGKIT_ENGINE_CHROME_HEADLESS_SHELL.renderalso needs the usual Chrome shared libraries (such as libnss3) from the distribution;doctordoes not check for them yet. - Intel Macs: the torch-backed commands (
cutout,upscale) refuse to run;grade fitneeds macOS 14 or later;inpaintis untested.
The quality cases were measured on Apple Silicon (MPS).