Images

For developersVersion 1.0.0Last updated:

OptionDefaultWhat it does
Lazy loadingOnImages and iframes (videos, maps) in sections that aren’t visible on load carry loading="lazy" and decoding="async". Attributes the package already sets are respected.
High priority for the main imageOnIn the first sections, BuilderOS finds the image that displays largest (by its width/height; the LCP candidate): it gives it fetchpriority="high" and removes lazy-load if it had it. If the package already marked an image with fetchpriority="high", it is respected and no other is added. Only one image per page gets high priority: those that come after it in that section (the other slides of a carousel, badges…) become fetchpriority="low" and loading="lazy", unless the package set loading or fetchpriority on them on purpose. An image with fetchpriority="low" is never chosen as the main one. One with only loading="lazy" yields to any other candidate image in the section; if it is the only candidate, it wins and loses the lazy. If the largest thing is an inline CSS background (for example a background field), it is preloaded with <link rel="preload" as="image"> (in WebP if it exists).
Reserve space for imagesOnSets the real aspect ratio of each package or library image (--bos-ar + aspect-ratio with zero specificity) so the page doesn’t jump on load (CLS). It doesn’t change the size it displays at: any package rule wins.
Responsive sizes for library imagesOnAdds srcset and sizes to media library images that lack them: mobile downloads a smaller version.
Mobile sizes (srcset) for package imagesOnOn sync (or with “Optimize the library”) it creates smaller WebP versions of each package image —480, 768, 1200 and 1600 px, only those smaller than the original, never upscaled— and on render adds srcset with those widths and sizes. Mobile downloads the one it needs; the src remains the original. See “Mobile sizes, in detail”.
Generate WebPOffCreates foto.jpg.webp next to each JPG/PNG from the package and from the media library that your pages use (for example, the photo you changed in the editor) and serves it only if it exists and weighs less. Also on inline backgrounds and in CSS url(). On turning it on, the conversion starts in the panel with its progress (see “Images”). It is off because it uses CPU and some hosts have no WebP support.
WebP for new images tooOn (if WebP is)Images you upload to the library are converted in the background, without delaying the upload. WordPress keeps creating its usual JPG/PNGs.
Shrink huge package images to 2560 pxOffThe WebP of package images wider than 2560 px is generated at 2560 px (foto.jpg.w2560.webp). Turn it on only if the package displays images at a size fixed by CSS (the usual: max-width: 100%); an image that displayed at its natural size of over 2560 px would look smaller. Library ones don’t need it: they already use srcset.
Sections visible on load1How many sections at the start load without lazy. The main section and the ones before it are never deferred.

How BuilderOS decides what is “above the fold”: the header (data-bos-role="header") always loads normally. Of the first two content sections, the one with the largest image or background is the main section. The sections before it and those in “Sections visible on load” load normally; the rest, deferred.

Library WebP, in detail:

  • Images that appear on pages with sections, in global items and in theme templates are converted (not the whole library), with all their sizes: foto.jpg.webp, foto-300x200.jpg.webp, foto-768x512.jpg.webp…
  • When rendering sections, src and srcset are swapped for the WebP only if the file exists and weighs less; if it is missing, the JPG/PNG is served.
  • The originals and WordPress’s sizes aren’t touched. If you deactivate or uninstall BuilderOS, pages keep showing the usual JPG/PNGs (on uninstall, the WebPs BuilderOS created are deleted). When you delete a library image, its WebPs are deleted too.
  • BuilderOS does not use WordPress’s image_editor_output_format filter: it would make intermediate sizes generate only in WebP (no JPG), which affects other plugins, email and feeds, and isn’t undone when the plugin is deactivated.
  • The name foto.jpg.webp is the same convention LiteSpeed Cache and other optimizers use: if one already exists, BuilderOS reuses it (and never deletes it).

Mobile sizes, in detail:

  • A package that already ships its images in WebP gains nothing from “Generate WebP”: what weighs is mobile downloading the desktop image (for example, a 956 px photo displayed at 330 px). The sizes solve that for JPG, PNG and WebP.
  • They are generated next to the original (foto.webp.w480.webp, foto.jpg.w768.webp…) inside the version folder and recorded in the manifest. They are kept only if they weigh less.
  • srcset carries the sizes and the original with its real width (foto.jpg 956w). sizes: on deferred images, auto, (max-width: Wpx) 100vw, Wpx (the browser uses the real width it displays at); on the rest, (max-width: Wpx) 100vw, Wpx, with W the width attribute.
  • So the look never changes, it is only added to images that have width and height with the same proportion as the file, that aren’t inside a <picture>, that don’t already have srcset, that aren’t SVG and to which no package rule gives an automatic width without fixing the height (width: auto, fit-content…): in those cases the size it displays at would depend on the chosen file.
  • The “Images” report shows the sizes created and an estimate of what a mobile downloads (412 px wide × 1.75, like PageSpeed).