Provides Images and Favicons upload collections that store only the original file. Sized variants are generated on request by a custom endpoint using Sharp, cropped to a focal point, and cached in a hidden purgeable collection. It adds a responsive image component, a focal-point admin field, a favicon picker field and an ImageChild block. Requires Payload 3 and the @pro-laico/core package, with sharp as an optional peer.
Atomic Payload images package. Provides Images + Favicons Payload upload collections, on-demand Sharp transforms with built-in LQIP placeholders (derived from the smallest variant), a FaviconField helper, an ImageChild block factory, and a plugin factory.
Installation
npm i @pro-laico/images37
Stars
0
Forks
0
Open Issues
2 months ago
Last Updated
1
Weekly Downloads
v0.5.0
npm Version
265.9 KB
Unpacked Size
1
Dependencies
Trends appear after 7 days of data. Collecting since Oct 22 — 2 daily snapshots so far.
Shared by 10 plugins in pro-laico/atomic-payload.
Trends appear after 7 days of data. Collecting since Oct 22 — 2 daily snapshots so far.
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1128550352-images)<a href="https://payloaddirectory.dev/plugins/1128550352-images"><img src="https://payloaddirectory.dev/badge/1128550352-images.svg" alt="Payload Directory"></a>README
On-demand image handling for Atomic Payload. Uploads store only the original; every rendered size is generated on request by a custom Payload endpoint (resize/crop/recompress with Sharp, cropped to a focal point) and cached as a hidden, purgeable variant collection. Ships a focal-point + ratio-preview admin field, a responsive <img> component (ResponsiveImage, no next/image), a dedicated favicons collection, a favicon-picker field, and an ImageChild block. Part of Atomic Payload.
pregenerateSizes restores the legacy ladder if you want it)./api/img/<id>?w&h&ar&fit&q&fmt&v → the endpoint reads the source + its focal point, transforms with Sharp, streams it back same-origin with immutable cache headers, and saves the result to the hidden generatedImages collection (via the configured storage adapter, so it's platform-agnostic).<ResponsiveImage image={…} aspectRatio="16:9" sizes="100vw" /> — a plain, fully server-rendered <img> whose srcset has the settings baked into each URL. The LQIP placeholder is built in and needs no stored field: the wrapper's background is the smallest transform variant (a tiny low-quality crop), which the browser upscales to a soft blur behind the image until the full size loads. Toggle it with the blur prop.variants join on each image, the Purge variants button, and automatic purge on re-upload / focal change / delete.Cache invalidation. Each transform URL carries a
vtoken derived from the source's filename + focal point (deriveVersion), so replacing the file or moving the focal point yields a new URL — busting otherwise-immutable browser/CDN caches while a metadata-only edit (e.g.alt) leaves it untouched. The server ignoresv(focal comes from the doc, and the variant cache key folds it in directly). This only works when you pass a populated doc to<ResponsiveImage>; a bare id has no identity to version, so its URLs omitv.
Environment. Cloud/relative-URL storage adapters are read by self-fetching the server's own static route, so set
NEXT_PUBLIC_SERVER_URLto your deployment origin — otherwise generation falls back tohttp://localhost:3000and fails in production (surfacing as a502). The endpoint mounts at a fixed/api/img; only passpathto<ResponsiveImage>/buildSrcsetif your Payload API route or Next.js basePath differs from the default.
@pro-laico/core — the only required @pro-laico/* dependency (cached image-URL getter, config/cache primitives, and the Get<>/PayloadAugment type system).@pro-laico/atomic — an optional peer, needed only for the ./blocks/imageChild subpath (the Atomic child block). The core image features — the Images collection, the on-demand transform endpoint, ResponsiveImage, the focal point UI, and the placeholder — don't need it, so the package works in any Payload + Next app with just @pro-laico/core.sharp is an optional peer (required for the transform endpoint; Payload already brings it).
| Import | What's there |
|---|---|
. | The everyday API — imagesPlugin (+ ImagesPluginOptions / TransformEndpointConfig) and the FaviconField helper. |
./schema | Image / GeneratedImage schema type stubs for the @pro-laico/core kernel. |
./cache | getCachedImage — cached image-URL getter (maps legacy size names to on-demand URLs). |
./components/image | ResponsiveImage — the responsive <img> component (server- and client-safe). |
./components/buildSrcset | getImageUrl / buildSrcset / buildVariantUrl / deriveVersion — isomorphic URL builders. |
./admin/focalPreview | Focal-point + ratio-preview admin field component. |
./admin/purgeVariants | "Purge variants" admin button component. |
./blocks/imageChild | ImageChild block — createImageBlock factory + prebuilt Image block. |
./blocks/imageChild/component | Child block renderer (ResponsiveImage-based). |
Topics
payload media
Search and import Unsplash, Pexels and Pixabay stock images and videos into Payload upload collections
80302/wk8v4
payload plugin aspect preview
Live multi-aspect-ratio previews with crop and focal point editing for Payload upload collections
7534/wk6v3
payload images
On-demand Sharp image transforms with focal-point cropping, placeholders and a responsive image component
596/wk18v3
image framing
Non-destructive crop and focus areas for Payload uploads, with per-usage overrides and cover areas
510/wk0v3
blur data urls
Generate blur placeholder data URLs automatically for images uploaded to Payload media collections
6966/wk83v3
payloadcms plugin image optimizer
Client-side pre-resize, ThumbHash blur placeholders, filename strategies and bulk regeneration for Payload uploads
62564/wk27v3