Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Utility to perform build-time image transformations.
Eleventy Image (@11ty/eleventy-img) is a build-time image transformation utility for the Eleventy static site generator, powered by the sharp image processor, that resizes, reformats, and caches images directly in your build pipeline.
Eleventy Image is a low-level utility plugin for Eleventy, a static site generator. It takes local or remote image files as input and produces resized, reformatted outputs (such as WebP, AVIF, JPEG, and PNG) at build time, writing them to your output directory. It requires Node 22 or later and is developed and maintained by the Eleventy team.
<picture>, <img>, or CSS background-image without being locked into a specific markup pattern.srcset and the sizes attribute.Install it with npm using npm install --save-dev @11ty/eleventy-img. Then, in your Eleventy configuration, you add the utility as a plugin and call it from your template code (such as Nunjucks or JavaScript). During each build, it processes the images, writes the transformed files to your output folder, and returns metadata you can use to construct your HTML.
Yes. It is an open-source npm package published by the 11ty organization on GitHub, so you can use it without cost and even contribute to its development.
It outputs resized and reformatted image files to your Eleventy output directory, and it can also return metadata like width, height, and source paths that you use in your templates.
It uses sharp, which supports encoding to WebP, AVIF, JPEG, and PNG, among others. You can specify which formats you want generated for each image.
Yes, it can cache remote images locally. When you pass a URL, it downloads the image once at build time and stores it in your build folder, avoiding repeated downloads on future builds.
The README states Node 22 or later is required. This allows the utility to use modern JavaScript features and keeps the dependency tree lean.
