Random Cat Picture Generator
Generate random cat pictures instantly. Browse, filter, favorite, and download adorable cat images from multiple public APIs.
About
Finding high-quality, random cat imagery for projects, placeholders, or simple amusement typically involves navigating cluttered stock photo sites or unreliable APIs. This generator pulls real photographs from multiple public cat image endpoints - primarily TheCatAPI and Cataas - with automatic failover if a source is unavailable. Each request returns a unique image at full resolution. The tool applies client-side Canvas pixel manipulation for filters (grayscale, sepia, brightness adjustments) rather than CSS-only effects, meaning the filtered version is what you actually download. Favorites persist in your browser via localStorage, so your collection survives page reloads. Note: image availability depends on upstream API uptime. Approximately 3 fallback sources are attempted per request before reporting failure.
Formulas
Image filter transformations are applied via direct pixel manipulation on an HTML Canvas. Each pixel is represented as a tuple of R, G, B, A values in the range [0, 255].
Grayscale conversion uses the luminance-weighted formula (ITU-R BT.601):
gray = 0.299 × R + 0.587 × G + 0.114 × BSepia tone applies a matrix transformation per pixel:
Rout = 0.393R + 0.769G + 0.189BGout = 0.349R + 0.686G + 0.168B
Bout = 0.272R + 0.534G + 0.131B
Brightness adjustment multiplies each channel by a factor b ∈ [0.0, 3.0]:
Cout = clamp(Cin × b, 0, 255)Contrast uses the standard formula with factor f derived from contrast level c ∈ [−100, 100]:
f = 259 × (c + 255)255 × (259 − c)Cout = clamp(f × (Cin − 128) + 128, 0, 255)
Where C represents any color channel (R, G, or B), and clamp restricts output to the valid byte range.
Reference Data
| API Source | Base URL | Auth Required | Rate Limit | Avg Response | Image Format | Breed Filter | Resolution | CORS | Reliability |
|---|---|---|---|---|---|---|---|---|---|
| TheCatAPI | api.thecatapi.com | No (basic) | ~10 req/min | ~200ms | JPG/PNG/GIF | Yes (with key) | Variable (up to 4K) | Yes | High |
| Cataas | cataas.com | No | Unlimited | ~400ms | JPG/PNG | No | Variable | Yes | Medium |
| PlaceKitten | placekitten.com | No | Unlimited | ~150ms | JPG | No | Custom (param) | Yes | High |
| Lorem Flickr | loremflickr.com | No | Unlimited | ~300ms | JPG | Tag-based | Custom (param) | Yes | Medium |
| Random Duck (comparison) | random-d.uk | No | Unlimited | ~100ms | JPG/GIF | No | Variable | Yes | High |
| HTTP Cat | http.cat | No | Unlimited | ~100ms | JPG | By HTTP code | Fixed | Yes | High |
| Cat Facts API | catfact.ninja | No | Unlimited | ~80ms | Text only | N/A | N/A | Yes | High |
| TheDogAPI (comparison) | api.thedogapi.com | No (basic) | ~10 req/min | ~200ms | JPG/PNG | Yes | Variable | Yes | High |
| Unsplash Source | source.unsplash.com | No (deprecated) | ~50 req/hr | ~500ms | JPG | Tag search | Custom | Yes | Low |
| Pixabay API | pixabay.com/api | Yes (key) | ~100 req/min | ~300ms | JPG/PNG | Search | Up to 5K | Yes | High |
| Pexels API | api.pexels.com | Yes (key) | ~200 req/hr | ~250ms | JPG | Search | Up to 6K | Yes | High |
| AWS Random Cat | aws.random.cat | No | Unlimited | ~350ms | JPG/GIF | No | Variable | Partial | Low |