imgpipe
v0.0.2
Published
Small image pipeline utilities for responsive visual surfaces.
Downloads
220
Maintainers
Readme
Imgpipe
Small image pipeline utilities for responsive visual surfaces.
Imgpipe is a tiny, dependency-free set of helpers for building visual surfaces. Learn more at artboards.dev.
npm i imgpipeimport { createRenderSize } from "imgpipe";
createRenderSize(320, 180, 2); // { width: 640, height: 360, pixelRatio: 2 }
import { createPipeline, pipelineFingerprint, compilePipeline } from "imgpipe";
const pipeline = createPipeline([
{ type: "resize", width: 640, height: 360 },
{ type: "format", mediaType: "image/webp", quality: 0.85 },
]);
pipelineFingerprint(pipeline); // stable cache key
compilePipeline(pipeline, { operations: ["resize", "format"] });