Simple Lorem Icon service
- bookmarkable image urls
- pseudo random images
- simple frontend to try out the service is at /help-me/
- if you want really permanent permalinks to the images, you should host this yourself somewhere, a dockerfile is included
A service to create random but bookmarkable placeholder images.
The service takes a number of parameters, you can see the structure of
the image URLs on the page at
/help-me/ (it is linked from the index page).
Image URL patterns
These URL patterns will return an image, the shorter URL patterns always redirect to the fully specified format.
- Just Dimensions:
- Style + Dimensions:
- Style, Dimensions, Format:
- Fully specified:
:y) can be specified without unit, which will be taken as
Other supported units are:
pt-- either 96ppi or 72dpi (for :format = pdf)
in-- either 96pixels or 72pixels (for :format = pdf)
cm-- converted at 2.54 cm / in
mm-- converted at 25.4 cm / in
px-- same as not specifying a unit
png-- lossless compression, ideal for icons; the default value
jpeg-- lossy compression, ideal for larger gradient images
jpg-- same as
svg-- vector format, pre-sized to given size
These will redirect you to a data: URL containing the generated image:
datapng-- convert image to png and encode as data: url
datajpeg-- convert image to jpeg and encode as data: url
data-- convert image to png and jpeg and redirect to the shorter one encoded as data: url
- https://loremicon.com/ngon/16/16/64110306/jpeg (16x16 pixel jpeg)
- https://loremicon.com/ngon/297mm/210mm/64110306/pdf (a4 pdf)
- https://loremicon.com/grad/20pt/20pt/64110306/svg (20pt svg)
To get additional control over the generated image, some part
of the randomly determined image parameters can be overridden
:extra part of the image URL (and this is only supported
as an extension of the fully specified form, for now):
- Extended specification:
:extra can be specified as either of these:
where the colors are either 3 or 6 hexadecimal digits (when separated with commas) or just general color strings (when separated with semicolons).
So these are equivalent:
/ngon/128/128/64110306/palette=rgb(0 255 255);rgb(0 0 255)/jpeg
Note: the spaces in the third example must, of course, be escaped as %20, but browsers should also accept commas as in the fourth example.
The following examples all use the same seed, so will not change on reload:
Two kinds of random:
Controlling the colors
In order to replace the randomly generated colors with a set
of pre-determined colors, you can specify either
palette=ccc,... as an additional path
segment before the format (which must always come last).
The difference between the two is how colors are selected:
colors, every time a color is needed, the next one from your list is used (and re-used, if more colors are needed than were given)
palettejust provides a list to select from, and every use of a color chooses one at random -- which means that it can use the same one every time, if that happens, maybe add another color to your list; this works because all "randomness" derives from the seed in the URL and is the same every time you request an image using the same seed
Currently builds on macOS using node 13.
Docker image uses Alpine Linux and node 14.