Boneyard Tools

The picsum.photos URL format explained

How the path picks random, seeded, or fixed images, what the grayscale and blur query flags do, and when to swap placeholders for real art.

Anatomy of a picsum.photos URL

Every Lorem Picsum URL starts with the host picsum.photos and ends with a size. In the simplest form the path is just the width and height, like /600/400, which returns a random photo cropped to those pixels. The trailing extension, .jpg or .webp, tells the service which file format to encode, and any options ride along after a question mark as query parameters. Reading a URL back to front, size then format then flags, makes even a long one easy to decode.

Random, seeded, and fixed images

The path segment before the size decides how stable the image is. A bare size gives a different random photo on every request, which is fine for a throwaway demo but a problem for screenshots that must match. Adding /seed/{text}/ maps any word you choose to one consistent image, so /seed/cat/ always returns the same picture at a given size. Adding /id/{number}/ instead pins an exact photo from the Picsum catalog by its identifier. Seeds and ids cannot be combined, since each names a single source.

Grayscale, blur, and format flags

Two visual modifiers attach as query parameters. The grayscale flag, written as a bare ?grayscale, strips color and returns a black-and-white version. The blur flag takes a level from 1 to 10, as in ?blur=4, where higher numbers soften the image more heavily. When both are present they join with an ampersand, producing ?grayscale&blur=4. These flags are useful for background imagery where you want texture without the photo competing for attention.

When to move past placeholders

Placeholder services are perfect during design and prototyping, but shipping them to production is risky. Each page view calls an external server you do not control, which adds latency, can fail offline, and offers no guarantee the picture stays the same or stays appropriate. Before launch, swap Picsum URLs for real assets served from your own domain or a CDN, ideally with explicit width and height so the layout does not shift as images load. Treat the generated URL as a stand-in, not a permanent dependency.

Frequently asked questions

Why does my random image keep changing on reload?

A URL with just a size requests a new random photo each time. Switch the image source to Seed or Image id so the same picture returns on every load.

Do the width and height crop or scale the photo?

Picsum returns the image already sized to the dimensions in the path, cropping the source photo to fit that aspect ratio rather than stretching it. Ask for the exact pixels your layout needs.