{"id":14942,"date":"2026-07-23T20:56:54","date_gmt":"2026-07-23T18:56:54","guid":{"rendered":"https:\/\/shortpixel.com/blog\/?p=14942"},"modified":"2026-07-23T20:56:55","modified_gmt":"2026-07-23T18:56:55","slug":"shortpixel-image-optimizer-is-now-also-available-for-drupal","status":"publish","type":"post","link":"https:\/\/shortpixel.com\/blog\/shortpixel-image-optimizer-is-now-also-available-for-drupal\/","title":{"rendered":"ShortPixel Image Optimizer Is Now Also Available for Drupal"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">We&#8217;re excited to announce that ShortPixel image optimization is now available for Drupal!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/www.drupal.org\/project\/shortpixel_plugin\" target=\"_blank\" rel=\"noopener\">ShortPixel ImageAPI Optimize Processor<\/a> is live on Drupal.org, and it brings the same compression engine our WordPress users have relied on for over a decade straight into Drupal&#8217;s image pipeline.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;ve been running a Drupal site and calling our API by hand, or just wishing there was a proper module for it, this one&#8217;s for you.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>So\u2026 what does it actually do?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Images generated through Drupal Image Styles can now be compressed and optimized by ShortPixel before they reach your visitors. Smaller files, the compression mode you choose, and faster delivery.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The module plugs into <a href=\"https:\/\/www.drupal.org\/project\/imageapi_optimize\" target=\"_blank\" rel=\"noopener\">Image Optimize<\/a>, the Drupal module used to build image optimization pipelines. If you already have a pipeline running with local tools like jpegoptim or optipng, you just add ShortPixel as another processor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The difference is where the work happens. Local binaries compress images using your server&#8217;s CPU, which is fine until you flush your image styles on a site with thousands of images and everything regenerates at once. ShortPixel does the optimization on our servers instead, so none of your hosting resources are consumed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One thing worth knowing up front: this works through Drupal&#8217;s Image Styles rather than through the media library. That&#8217;s how Drupal expects image handling to work, and it means your original uploads are never modified.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How it works<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Drupal generates an image using an Image Style. Our processor picks it up from there:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The generated image is uploaded to ShortPixel through the POST-Reducer API<\/li>\n\n\n\n<li>The processor waits until optimization is complete<\/li>\n\n\n\n<li>The optimized image replaces the generated Image Style file<\/li>\n\n\n\n<li>Your original source image stays exactly as it was<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">That last point matters more than it might look. Because Drupal always keeps a clean original, you can flush your image styles whenever you want and everything regenerates from scratch.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because the original stays untouched, you don&#8217;t need a separate backup of the optimized derivatives. Flush your Image Styles and Drupal regenerates them from the source file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Two ways to deliver your images<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is the one real choice you&#8217;ll make during setup, and both options are good ones. They&#8217;re just different approaches.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Post-Reducer mode<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Each Image Style derivative gets uploaded to ShortPixel, optimized, and sent back to your server. Same files, same URLs, just lighter.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pick this if:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You want your optimized images stored on your own infrastructure<\/li>\n\n\n\n<li>You already run a CDN and just want smaller files sitting behind it<\/li>\n\n\n\n<li>Compliance or hosting rules mean assets need to stay with you<\/li>\n\n\n\n<li>You want the simplest mental model possible<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>CDN delivery mode<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of processing files locally, the module rewrites your public image URLs to ShortPixel&#8217;s Adaptive Images CDN format. You point it at cdn.shortpixel.ai, no-cdn.shortpixel.ai, or your own CDN host, and your selected compression mode stays in sync automatically.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With this enabled, local uploads are skipped entirely. The CDN handles both the optimization and the delivery.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pick this if:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You want WebP and AVIF served automatically based on each visitor&#8217;s browser<\/li>\n\n\n\n<li>You&#8217;d rather not add optimization time to derivative generation<\/li>\n\n\n\n<li>You want a CDN and don&#8217;t already have one<\/li>\n\n\n\n<li>Your site has lots of images that are rarely requested, so processing them all locally would be wasteful<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The short version: choose Post-Reducer if you want optimization to happen before storage, and CDN delivery if you want it to happen during delivery.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Compression modes<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">All three ShortPixel compression strategies are available, selectable directly from the processor configuration:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Mode<\/strong><\/td><td><strong>What it does<\/strong><\/td><td><strong>Best for<\/strong><\/td><\/tr><tr><td><strong>Lossy<\/strong><\/td><td>Best balance between quality and file size<\/td><td>Most websites<\/td><\/tr><tr><td><strong>Glossy<\/strong><\/td><td>High quality with minimal visual loss<\/td><td>Photography, premium visuals<\/td><\/tr><tr><td><strong>Lossless<\/strong><\/td><td>Pixel-perfect, no visual change<\/td><td>Technical images, graphics, screenshots<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Lossy is the right default for the large majority of sites. If your images <em>are<\/em> the product, try Glossy and compare a few files at full resolution before you commit.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What kind of savings are we talking about?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When we <a href=\"https:\/\/shortpixel.com\/blog\/batch-compress-11000-images\/\">batch compressed 11,000 mixed photographic images<\/a> with standard Lossy settings, the set came down 46.5%, from 536.6 MB to 287.2 MB.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That was a diverse dataset, not a cherry-picked one. Your own results will depend on your images and how compressed they already were.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But here&#8217;s the part that matters for Drupal specifically: your site doesn&#8217;t store one file per upload. It generates a derivative for every Image Style you&#8217;ve defined. A site with 1,000 uploaded images can easily have five or ten times that many files on disk, and savings like these apply across the whole pipeline.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Smaller derivatives can mean less storage used, less data transferred, faster page loads, and an improvement in image-related LCP issues. And your editors never have to think about any of it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Do you need this?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If your Drupal site has years of editorially uploaded images behind it, the module is well worth testing. Derivatives accumulate quickly, especially when several Image Styles are generated for every upload.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s a particularly good fit if:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You&#8217;re running Image Optimize with local binaries and want better compression without the CPU usage<\/li>\n\n\n\n<li>You manage Drupal sites for clients and want one image setup that works the same way everywhere<\/li>\n\n\n\n<li>You want WebP and AVIF delivery without building the negotiation logic yourself<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Ready to try it?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.drupal.org\/project\/shortpixel_plugin\" target=\"_blank\" rel=\"noopener\">Install it<\/a>, add ShortPixel as a processor in your Image Optimize pipeline and enter your API key.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll need a <a href=\"https:\/\/shortpixel.com\/\">ShortPixel API key<\/a>, which is free. The free account includes 100 image optimizations per month, so you can test the whole setup on staging before committing to anything.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two quick tips while you&#8217;re setting up. Test on staging first, flush your image styles there, and look at a few regenerated images at full resolution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The module supports Drupal 9, 10, and 11.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>FAQs<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Does this replace my original images?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No. Only the generated Image Style derivatives are optimized. Your source files stay untouched, which is both a Drupal requirement and a useful safety net.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Do I need Image Optimize installed?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. This is a processor for it, not a standalone module.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>How are optimizations counted against my plan?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Each Image Style derivative is processed separately. A credit is used when a file can be optimized by at least 5%.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Can I use my own CDN?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. In CDN delivery mode you can set your own CDN host as the base URL. Or use Post-Reducer mode and leave your existing CDN configuration exactly as it is.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Does it convert to WebP or AVIF?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In CDN delivery mode, yes, with format delivery handled per visitor. If a visitor\u2019s browser doesn\u2019t support AVIF, WebP will be displayed. If WebP isn\u2019t supported either, an optimized JPG will be delivered. In Post-Reducer mode, the derivative keeps its original format and is compressed in place.<\/p>\n\n\n\n<div class=\"wp-block-group has-border-color has-palette-color-4-border-color has-palette-color-6-background-color has-background is-vertical is-content-justification-left is-layout-flex wp-container-core-group-is-layout-02a0377d wp-block-group-is-layout-flex\" style=\"border-width:1px;border-radius:20px;margin-top:var(--wp--preset--spacing--60);margin-bottom:var(--wp--preset--spacing--60);padding-top:var(--wp--preset--spacing--60);padding-right:var(--wp--preset--spacing--60);padding-bottom:var(--wp--preset--spacing--60);padding-left:var(--wp--preset--spacing--60)\">\n<h3 id=\"cta-heading\" class=\"wp-block-heading\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\"><strong>Try ShortPixel on Drupal for free!<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Easily optimize your pictures and generate WebP\/AVIF in bulk using ShortPixel Image Optimizer.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/www.drupal.org\/project\/shortpixel_plugin\" target=\"_blank\" rel=\"noreferrer noopener\">Get Started<\/a><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re excited to announce that ShortPixel image optimization is now available for Drupal! The ShortPixel ImageAPI Optimize Processor is live on Drupal.org, and it brings the same compression engine our WordPress users have relied on for over a decade straight into Drupal&#8217;s image pipeline. If you&#8217;ve been running a Drupal site and calling our API [&hellip;]<\/p>\n","protected":false},"author":37,"featured_media":14943,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[2],"tags":[],"class_list":["post-14942","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-updates-and-news"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/posts\/14942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/comments?post=14942"}],"version-history":[{"count":1,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/posts\/14942\/revisions"}],"predecessor-version":[{"id":14945,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/posts\/14942\/revisions\/14945"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/media\/14943"}],"wp:attachment":[{"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/media?parent=14942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/categories?post=14942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/tags?post=14942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}