---
title: "s.pfos.school — QR code designer"
description: "QR codes for s.pfos.school short links, with custom colors, shapes and logos, as image URLs."
url: "https://s.pfos.school/qr"
markdown: "https://s.pfos.school/qr.md"
---
# s.pfos.school — QR code designer
The page `https://s.pfos.school/qr` designs a QR code for an s.pfos.school short link (colors, shapes, a logo) and saves it as PNG or SVG. An agent does not need the page: every design option is a query parameter of the image URL `https://s.pfos.school/{code}.svg` or `.png`.
1. Get a short link: the MCP tool `shorten_url` (server `https://s.pfos.school/mcp`) or `POST https://s.pfos.school/api/v1/public/links` with `{"url": "..."}`. QR codes exist only for short links.
2. Pick a preset below, or set the options yourself.
3. Use the image URL as it is (for example in `<img src>`) or download it. For a logo in the middle, use `POST /api/v1/qr`.
To make links and QR codes as an account (its history, the higher limits), send a pfos-ID access token for the resource `https://s.pfos.school/qr` (scope `links:write`; metadata at `https://s.pfos.school/.well-known/oauth-protected-resource/qr`, RFC 9728). It works for `POST /api/v1/public/links` and `POST /api/v1/qr` only. How to get one: `https://s.pfos.school/auth.md`.
Full reference: `https://s.pfos.school/docs.md`
## Presets
The looks offered on the page, with the names it shows. Add the query to the image URL, e.g. `https://s.pfos.school/Ab3xZ9q.svg?fg=8b2820&dot=dots&eye=circle&pupil=circle`.
| Preset | Query |
|---|---|
| クラシック | (none: the defaults) |
| ペーパー | `fg=14130f&bg=f5f2ec&dot=rounded&eye=rounded&pupil=rounded` |
| えんじ | `fg=8b2820&dot=dots&eye=circle&pupil=circle` |
| オーシャン | `fg=1d3557&fg2=2a7f9e&bg=eef5fb&dot=fluid&eye=rounded&pupil=rounded` |
| サンセット | `fg=c0392b&fg2=d35400&grad=r&dot=dots&eye=circle&pupil=rounded` |
| フォレスト | `fg=2d6a4f&bg=eef7f1&dot=vline&eye=leaf&pupil=leaf` |
| アクセント | `fg=14130f&dot=hline&eyec=8b2820&pupc=8b2820` |
| バイオレット | `fg=5a189a&fg2=9d4edd&grad=v&dot=diamond&eye=rounded&pupil=rounded` |
## QR codes
`GET /{code}.svg` and `GET /{code}.png` return the QR code of an existing short link; it encodes the short URL `https://s.pfos.school/{code}`. No authentication. Images are cached for 24 hours; `404` when the link does not exist (`{"error": "Not found"}` with `Accept: application/json`).
### Query parameters
All optional. Colors are 6 (or 3) hex digits without `#`. Invalid values fall back to the default.
| Name | Default | Values |
|---|---|---|
| `ec` | `M` | Error correction: `L` ~7%, `M` ~15%, `Q` ~25%, `H` ~30%; always `H` when `lw`/`lh` is set |
| `s` | `8` | PNG only: pixels per module, 2–32 |
| `m` | `4` | Quiet zone in modules, 0–16 (2 or more recommended) |
| `fg` | `000000` | Module color (gradient start) |
| `fg2` | none | Gradient end color; setting it makes a gradient |
| `grad` | `d` | Gradient direction: `d` diagonal, `v` vertical, `h` horizontal, `r` radial |
| `bg` | `ffffff` | Background color, or `transparent` |
| `dot` | `square` | Module shape: `square`, `rounded`, `fluid`, `dots`, `diamond`, `vline`, `hline` |
| `eye` | `square` | Finder ring shape: `square`, `rounded`, `circle`, `leaf` |
| `pupil` | `square` | Finder center shape: `square`, `rounded`, `circle`, `leaf` |
| `eyec` | `fg` | Finder ring color |
| `pupc` | `fg` | Finder center color |
| `lw`, `lh` | none | Area kept clear for a logo, as a fraction of the QR width, 0.05–0.3 (one alone makes a square); marked in the SVG as `<rect id="logo-area">` |
Scanning tips:
- Pair `eye` and `pupil` as `square`+`square`, `rounded`+`rounded`, `circle`+`circle`, `circle`+`rounded` or `leaf`+`leaf`; other pairs fail in some readers.
- Keep dark modules on a light background with strong contrast; inverted or low-contrast codes fail on some phones.
- For print, prefer SVG, or PNG with `s=16` or more, and `ec=H`.
```bash
# round dots, round eyes, brick red
curl -o qr.svg "https://s.pfos.school/Ab3xZ9q.svg?dot=dots&fg=8b2820&eye=circle&pupil=circle"
# fluid modules with a diagonal gradient, 16 px per module
curl -o qr.png "https://s.pfos.school/Ab3xZ9q.png?s=16&dot=fluid&fg=1d3557&fg2=2a7f9e&eye=rounded&pupil=rounded"
# transparent background
curl -o qr.png "https://s.pfos.school/Ab3xZ9q.png?bg=transparent"
```
```html
<img src="https://s.pfos.school/Ab3xZ9q.svg" alt="QR code" width="200" height="200">
```
The QR code designer at `https://s.pfos.school/qr` builds these URLs in the browser.
### QR code with a logo
`POST /api/v1/qr` — a QR code with a PNG logo in the center (the modules under the logo are removed and error correction becomes `H`). No authentication; 30 requests per minute per IP address, or 120 per account with a token (an access token needs `links:write`, for the resource `https://s.pfos.school` or `https://s.pfos.school/qr`); rendered on every request (not cached); the logo is not stored.
| Field | Type | Required | Description |
|---|---|---|---|
| `link` | string | yes | Short code or short URL |
| `format` | string | no | `png` (default) or `svg` (the logo is embedded as a data URL) |
| `logo` | string | no | PNG as a data URL (`data:image/png;base64,...`) or bare base64; up to 1 MB and 1024×1024 px; interlaced PNGs are not supported |
| `ls` | number | no | Logo size: its longer side as a fraction of the QR width, 0.05–0.3, default 0.22; `lw`/`lh` override it |
| `s` | number | no | PNG pixels per module, 2–32, default 8 |
| `fg`, `dot`, `eye`, ... | | no | The same design options as the query parameters above |
```bash
curl -X POST https://s.pfos.school/api/v1/qr \
-H "Content-Type: application/json" \
-d "{\"link\":\"Ab3xZ9q\",\"format\":\"png\",\"s\":16,\"dot\":\"rounded\",\"logo\":\"data:image/png;base64,$(base64 -w0 logo.png)\"}" \
-o qr-logo.png
```
The response is the image (`image/png` or `image/svg+xml`). Errors are JSON `{"error": "..."}`: `400` bad input, `404` unknown link, `413` body over 2 MB, `429` rate limit.