Getting started

Connect your images to Small Pics, request your first transform, and add Small Pics URLs to your site.

← Back to docs

Before you start

1. Create an image origin

An image origin tells Small Pics where your original images live. In the dashboard, open Image Origins and choose New image origin.

Your images are now available at https://mysite.smallpics.io/.

2. Request your first transform

Take the path of any image on your site and put it after your Small Pics hostname. If this image exists:

https://www.example.com/uploads/photo.jpg

Open this URL in your browser to get an 800px-wide AVIF version:

https://mysite.smallpics.io/uploads/photo.jpg?w=800&fm=avif

Change the query parameters to resize, crop, and convert. The playground shows every parameter on sample images, and the API reference describes each one.

3. Add Small Pics URLs to your site

Point your image tags at your Small Pics hostname instead of your site:

<img
  src="https://mysite.smallpics.io/uploads/photo.jpg?w=800"
  srcset="https://mysite.smallpics.io/uploads/photo.jpg?w=400 400w,
          https://mysite.smallpics.io/uploads/photo.jpg?w=800 800w,
          https://mysite.smallpics.io/uploads/photo.jpg?w=1600 1600w"
  sizes="(max-width: 800px) 100vw, 800px"
  alt="">

Leave out fm and Small Pics serves AVIF by default. In most templates, a small helper function that builds these URLs keeps the markup readable.

Optional settings