Brightness
?brightness=dark Every image is graded light, medium or dark by luminance while it is scanned.
SELF-HOSTED WALLPAPER API · GO · PORT 8519
Turn your image folders into a self-hosted API and gallery. Filter by brightness, size, aspect ratio, orientation and colour — and get the image itself back. No JSON parsing required.
Single Go binary · Docker · systemd · No database
→ 200 OK · image/webp · raw image response
Fresh examples come from Unsplash. Wallpaper Server itself serves images from your own folders.
→ 200 OK · image/webp · raw image response
Fresh examples come from Unsplash. Wallpaper Server itself serves images from your own folders.
→ 200 OK · image/webp · raw image response
Fresh examples come from Unsplash. Wallpaper Server itself serves images from your own folders.
Raw image responses
The endpoint returns the file, not JSON.
Automatic classification
Luminance, colour and shape detected on scan.
One Go binary
A single process. Nothing else to run.
No external database
The index is built from your folders.
Docker + systemd
Container or boot service, your call.
01 — DIRECT API
/api/wallpapers/random/image responds with the wallpaper itself — ready to save, set or pipe. Automation tools skip the metadata step entirely.
The usual way
Wallpaper Server
curl -o wallpaper.jpg \
"http://localhost:8519/api/wallpapers/random/image?brightness=dark"
Also: /random/thumbnail for thumbnails,
/{id}/image for a specific wallpaper.
02 — FILTERS
Every filter is computed automatically during scanning — combine them freely in one query string.
?brightness=dark Every image is graded light, medium or dark by luminance while it is scanned.
?dominant_hue=cool Images are sorted into red, green, blue, warm, cool or neutral by dominant colour.
?min_width=3840 Bound width and height to guarantee the resolution a screen actually needs.
?aspect_ratio=ultrawide Filter by 16:9, 4:3, ultrawide, square or portrait shapes.
?orientation=portrait Landscape, portrait or square — pick what fits the device.
?format=webp Constrain results to a specific file type when it matters.
/random/thumbnail Processed images and thumbnails are cached on disk, so repeat requests skip reprocessing.
wallpaper_folders List any number of directories in your config; every folder feeds one shared index and one API.
03 — AUTOMATIC ANALYSIS
Point the server at your folders. Every image is measured and indexed before it's ever requested.
Configured folders are scanned; uploads land in the same pipeline.
Luminance, dimensions, orientation, aspect-ratio category and dominant hue are computed per image.
The wallpaper becomes available to filtered API calls and the gallery.
{
"filename": "warm-dune.webp",
"width": 2560, "height": 1440,
"brightness": "medium",
"aspect_ratio": "16:9",
"orientation": "landscape",
"dominant_hue": "warm",
"luminance": 0.62
} 04 — WEB UI
A responsive gallery ships in the same binary — browse, filter, upload and manage without touching the API.
Screenshot-style preview of the gallery UI showing filter dropdowns and a wallpaper grid.
05 — AUTOMATION
Anything that can fetch a URL can set a wallpaper. These are the exact recipes from the README.
# crontab -e — light mornings, dark evenings
0 8 * * * curl -s -o ~/wallpaper.jpg "http://your-server:8519/api/wallpapers/random/image?brightness=light" && gsettings set org.gnome.desktop.background picture-uri "file://$(realpath ~/wallpaper.jpg)"
0 20 * * * curl -s -o ~/wallpaper.jpg "http://your-server:8519/api/wallpapers/random/image?brightness=dark" && gsettings set org.gnome.desktop.background picture-uri "file://$(realpath ~/wallpaper.jpg)" http://your-server:8519/api/wallpapers/random/image?brightness=dark http://your-server:8519/api/wallpapers/random/image?brightness=light http://your-server:8519/api/wallpapers/random/image?brightness=dark # configuration.yaml — host set to your-server; otherwise verbatim
shell_command:
set_random_wallpaper: >
curl -s -o /config/www/wallpaper.jpg
"http://your-server:8519/api/wallpapers/random/image?brightness=light"
automation:
- alias: "Morning Wallpaper"
trigger:
platform: time
at: "07:00:00"
action:
service: shell_command.set_random_wallpaper 06 — DEPLOY
Build it with Go, point it at a folder, and it's serving on port 8519.
git clone https://github.com/Ajaymamtora/wallpaper-server.git
cd wallpaper-server
go build -o wallpaper-server
./wallpaper-server --config config.yaml --start server:
host: "0.0.0.0"
port: 8519
wallpaper_folders:
- "~/Pictures/Wallpapers"
cache_dir: "~/.cache/wallpaper-server"
uploads_dir: "~/.local/share/wallpaper-server/uploads"
supported_extensions: [".jpg", ".jpeg", ".png", ".webp"] docker build -t wallpaper-server . Multi-stage image, runs as non-root, EXPOSE 8519.
sudo ./wallpaper-server --autostart --config /path/to/config.yaml Installs and enables a boot service.
07 — API SURFACE
Same filter query string everywhere it makes sense.
/api/wallpapers/random/image Random image file /api/wallpapers/random/thumbnail Random thumbnail /api/wallpapers/{id}/image Specific image /api/wallpapers/{id}/thumbnail Specific thumbnail /api/wallpapers List + filters /api/wallpapers/random Random metadata /api/wallpapers/{id} Metadata by id /api/upload Multipart upload /api/refresh Rescan folders /api/wallpapers/{id} Delete /api/settings Read / update config /api/info API info + examples 08 — SELF-HOSTED
Images are scanned, analysed and served entirely on your own hardware. There is no hosted processing step and no account required — one server can serve every phone, desktop and dashboard on your network.
09 — FAQ
No. It's a single Go binary and a single process. The wallpaper index is built by scanning your folders, and processed images are cached on disk — ~/.cache/wallpaper-server by default.
Yes. List any number of directories under wallpaper_folders in config.yaml; they're all scanned into one index and served through the same API.
Automatically, during scanning and upload. The server measures luminance, dimensions, orientation, aspect-ratio category and dominant hue for every image — no manual tagging.
Yes — that's the point. /api/wallpapers/random/image and /api/wallpapers/{id}/image respond with the image file itself, so a single URL is enough for Shortcuts, Tasker or curl.
.jpg, .jpeg, .png and .webp by default — configurable via supported_extensions.
Yes. The gallery supports drag-and-drop upload, and there's a POST /api/upload endpoint for multipart uploads. Uploads are analysed and indexed immediately.
Both. A multi-stage Dockerfile is included, and sudo ./wallpaper-server --autostart installs a systemd service that starts on boot.
Yes — any tool that can fetch a URL. The README ships recipes for all three, plus cron and multi-monitor scripts.
Self-hosted. Single binary. Direct image responses.