@lacspace/image
Generate images without AI — draw gradients, patterns and placeholders, resize and crop, then export to PNG, JPEG, WebP or SVG with an exact file-size budget (KB/MB). Zero-dependency and isomorphic: native Canvas in the browser, pure-JS PNG (zlib) and baseline JPEG encoders in Node, plus a fit() that binary-searches quality to hit a size ceiling.
npm i @lacspace/imageUsage
import { gradient, encode, fit, formatBytes } from "@lacspace/image";
const bg = gradient(1200, 630, {
angle: 90,
stops: [{ offset: 0, color: "#22d3ee" }, { offset: 1, color: "#6366f1" }],
}).pattern("dots", { size: 32 });
// Export in any format
const png = await encode(bg, { format: "png" });
// …or hit an exact file-size budget
const small = await fit(bg, { format: "jpeg", maxSize: "120kb" });
console.log(formatBytes(small.size), "at q", small.quality);Exports 12
SurfacegradientradialpatternencodefitencodePngencodeJpegrasterizeSvgparseSizeformatBytesparseColorKeywords
More in Media Kit
Generate real logos and brand marks without AI. A name + a few keywords becomes an on-brand SVG logo — monogram, icon lockup, geometric mark or emblem — chosen deterministically from a curated JSON brain of palettes, fonts, icons and shapes. Seeded variations, five engines, and generateLogoSet for 12 reproducible concepts. Rasterize via @lacspace/image.
@lacspace/brandThe official Lacspace mark, colours and animations — for everyone to use. Render the self-contained SVG logo and the signature self-crafting reveal anywhere (zero-dep, isomorphic), make Lacspace installable as a favicon / PWA app-icon in one call, and reach the pixel-exact master artwork + Lottie motion bundled inside. Free to reference Lacspace under the Brand Usage Licence — don't alter the mark. Includes React bindings.