Gatsby's image plugin is a serious toolkit that covers lazy-loading, resizing, placeholders and next-gen formats (WebP and AVIF). Quality and pixel density can be tuned, and breakpoints keep the served variant matched to a screen-size threshold. What the plugin cannot do is decide any of this on its own: there is no built-in client hints support, and device detection, dynamic logic for picking settings per visitor, and ongoing maintenance of that logic all remain the developer's job. Every new device model or change to performance standards, or even a significant change to your own image assets, can force rework. Without an intelligent engine behind it, teams also have to feel out how settings affect perceived quality and fine-tune repeatedly. And since Gatsby notes that these techniques are CPU intensive, preoptimizing images is an option, though it is less dynamic and must be wired up in-code.
What ImageEngine Says About Its Approach
An image CDN can take over this problem and leave Gatsby the job of handling what it does well: breakpoints, lazy-loading and placeholders, with no extra expertise required. A typical ACCEPT header, as shown above, tells a CDN only which image formats are acceptable and what quality compression is recommended. ImageEngine additionally uses client hints for data such as DPR (device pixel ratio) and Viewport-Width, and reads WRITE-WORKSHOP
image/avif,image/webp,image/apng,image/*,*/*;q=0.8
Beyond that, Client Hints and WURFL data feed machine-learning logic on the edge. Per ImageEngine, this means it does all of the following automatically:
- Resizing images to the device screen size without responsive syntax.
- Compressing quality to cut payload while preserving visual quality, guided by metrics such as the Structural Similarity Index Method (SSIM).
- Converting to the most efficient encoding, including WebP and AVIF plus JPEG 2000, JPEG XR and MP4 for animated GIFs.
Because that decision-making runs on edge servers, processing happens server-side rather than at build or request time, and with more than 20 global PoPs the optimized variants are served from close to the visitor.
[prose]
Wiring ImageEngine into a Gatsby project
The integration itself follows the pattern of any third-party Gatsby plugin, though the exact steps depend on which CMS backs your project and where the image assets live. WordPress, Drupal, Contentful and other popular systems all work. A typical stack consists of a CMS to hold your space, assets and structured data; a versioning platform such as GitHub; and GatsbyJS as the workspace for building, deploying and hosting the front end.
Start by creating a GatsbyJS project and connecting it to your CMS. Then install the ImageEngine plugin:
npm install @imageengine/gatsby-plugin-imageengine
The plugin needs a delivery address, which you obtain by signing up for ImageEngine's 30-day trial and supplying the host origin URL — images.ctfassets.net for Contentful, cdn.sanity.io for Sanity.io. ImageEngine returns an address of the form {random_string}.cdn.imgeng.in, and that address goes into your gatsby-config.js along with the asset source. Contentful and Sanity.io are supported out of the box; local images or a custom source can also be configured.
Querying image variants through GraphQL
With configuration done, Gatsby generates GraphQL nodes for CMS elements (ContentfulAsset, allSanityImageAsset and similar), and ImageEngine adds a childImageEngineAsset child node for each applicable element. Page code then uses GraphQL queries to request specific image variants. A 500 ✕ 300px WebP image, for instance:
gatsbyImageData(width: 500, height: 300, format: jpg)
Documentation covers the full details, with separate guides for Contentful, Sanity.io and generic Gatsby projects. For a competent Gatsby user the setup takes only a few minutes with minimal ongoing maintenance, and anyone familiar with GraphQL will find the directive syntax for creating variants nearly effortless — roughly comparable to manually optimizing images with standard Gatsby React.
Pairing runtime optimization with front-end best practices
ImageEngine can cut image payloads by up to 80% on most web projects, and more when images are especially high-resolution. The combination with Gatsby is where the two tools complement each other against Google's core web vitals:
- ImageEngine's dynamic, intelligent run-time optimization improves LCP, SI, FCP and other data size-related metrics.
- Gatsby's best practices, plus native lazy loading and image placeholders, target CLS and FID.
ImageEngine's Image Speed Test tool lets you evaluate current performance and see the effect on key metrics; even a simple GatsbyJS project shows notable results in the demo, and extrapolating those percentages to a larger, image-heavy site suggests a dramatic impact on performance and user experience. A side benefit: developers are spared the challenging, time-consuming chore of manual image optimization.



