Built in

Image optimization

Big photos are the most common reason a page loads slowly. pepita makes a smaller copy of every image when you publish, and keeps your original exactly as it was.

How it works

When you publish, every .jpg, .jpeg and .png in your site gets a WebP copy beside it, with .webp added to its name:

  • editor.png4.0 MB · original
  • editor.png.webp164 KB · optimized
A real example from this site: the same screenshot, about 24 times smaller.

Photos straight from a camera or phone are also scaled down to at most 2560 pixels on their longest side, which is still sharp on large high-resolution screens. For those, that is often the biggest saving of all.

Which address to use

On your own pagesPoint at the copy: <img src="/hero.jpg.webp">. The AI does this for you.
Anywhere elseSocial preview images (og:image), emails and links you share should use the original, /hero.jpg. Some link previews and email apps still don't show WebP.
Using the .webp address can't break an image. If the copy doesn't exist yet (a new image you haven't published, or one that didn't get smaller) pepita serves the original instead.

The small print

  • Only JPG and PNG are converted. SVG, GIF, ICO and WebP files are served as they are.
  • A copy is kept only if it is smaller. Some simple graphics come out bigger as WebP, and those just use the original.
  • If you upload your own hero.jpg.webp, pepita never overwrites it.
  • Your original's address never changes and always serves exactly the file you uploaded.

Prefer the originals for photography? Point your pages at them and ignore the copies.

Adding images

Drag images from your computer into Files in the code editor. Images for collection items are uploaded in each item's form instead. For moving pictures, use video hosting rather than large GIFs.