Fakeimg.pl and fakeimg Alternatives for Production Apps
Compare fakeimg.pl with modern fakeimg alternative services and learn which placeholder API is appropriate for development mockups versus real production fallback states.
Fakeimg.pl is a simple placeholder image service that generates labeled rectangles. It works well for quick mockups but lacks the reliability, format options, and production-oriented features that real fallback states require. If you are shipping fakeimg URLs to production, you have a problem.
This guide covers what fakeimg.pl provides, where it falls short for production use, and how to migrate to a URL-based alternative that supports avatars, skeletons, blur placeholders, and deterministic CDN caching.
What fakeimg offers
What fakeimg.pl provides and where it is useful
Fakeimg.pl generates a PNG image with a gray background and white text showing the dimensions. You can pass custom background and text colors as URL path segments. The URL format is /WIDTHxHEIGHT/BGCOLOR/TEXTCOLOR with an optional text query parameter.
It is useful for rapid wireframing and initial HTML layout work where you need a visible image of a specific size without sourcing a real photo. Many developers use it as a starting point for mockups before final assets are available.
The limitation is that fakeimg.pl is a third-party service with no SLA, no CDN, and no guaranteed uptime. In 2022 and 2023 the service experienced extended downtime, breaking mockups and demo deployments that had not replaced the development URLs before shipping.
Production problems
Why fakeimg URLs should not reach production
Any dependency on a third-party service you do not control is a production risk. If fakeimg.pl goes down—as it has—your fallback images return 503s. A 503 on an image URL shows the broken-image icon, which is exactly the problem a fallback image is supposed to prevent.
Fakeimg.pl does not send CDN-friendly cache headers for all responses. Without long-lived Cache-Control headers, each page load may generate a new request to the origin server rather than serving from a CDN edge node. For high-traffic pages, this adds latency and load.
There is no avatar route, no skeleton loader, no blur placeholder, and no thumbnail generator. For production apps with multiple image states—empty avatar slots, skeleton loading grids, blog thumbnails—you end up combining multiple services with inconsistent URL formats.
URL comparison
Translating fakeimg URLs to fallback.pics equivalents
The URL translation is straightforward. The fakeimg path format maps directly to the fallback.pics dimension format. Custom colors and text parameters both exist in fallback.pics with minor syntax differences.
The main difference is the base domain and the /api/v1/ prefix. Your build pipeline or a simple find-and-replace can handle bulk migration across a codebase.
# fakeimg.pl format
https://fakeimg.pl/400x300/ # gray placeholder
https://fakeimg.pl/400x300/7C3AED/FFFFFF # custom colors
https://fakeimg.pl/400x300/?text=Hello # with text
# fallback.pics equivalents
https://fallback.pics/api/v1/400x300 # gray placeholder
https://fallback.pics/api/v1/400x300/7C3AED/FFFFFF # custom colors
https://fallback.pics/api/v1/400x300?text=Hello # with text
# Features fakeimg does not have
https://fallback.pics/api/v1/avatar/80?text=AB
https://fallback.pics/api/v1/animated/skeleton/400x300
https://fallback.pics/api/v1/blur/400x300
https://fallback.pics/api/v1/thumbnail/1200x630?text=Blog+Title&style=soft Migration
Migrating a codebase from fakeimg to a production-safe alternative
Search the codebase for all fakeimg.pl URLs. In most JavaScript and TypeScript projects, a simple rg or grep for fakeimg.pl surfaces all occurrences. Update them in bulk using a script or your IDE's find-and-replace across files.
Pay attention to dynamic URL construction. If fakeimg URLs are built from templates using width and height variables, make sure the template updates to the new format rather than just replacing the domain. The path structure is close enough that a regex substitution usually works.
Add a CI lint rule or a grep check in your deployment pipeline that fails the build if fakeimg.pl appears in any source file. This prevents accidental regression after the migration.
# Find all fakeimg.pl references in a JS/TS project
rg "fakeimg\.pl" --type ts --type js
# Bulk replace in place (macOS sed syntax)
rg -l "fakeimg\.pl" | xargs sed -i '' 's|fakeimg.pl|fallback.pics/api/v1|g'
# Add to CI as a lint check (package.json script)
# "lint:images": "! rg fakeimg.pl src/" Feature gaps
What you get from a modern fakeimg alternative
A modern URL-based placeholder API provides routes beyond basic dimension rectangles. Avatar placeholders with initials or a question mark fill user profile slots. Animated skeleton placeholders fill loading states. Blur placeholders fill LQIP slots. Thumbnail routes fill blog featured image slots with title text.
All of these are accessible from deterministic URLs with predictable CDN caching. You do not need to host image files, maintain an image generation server, or depend on a third-party service with no SLA.
Avatar route
https://fallback.pics/api/v1/avatar/80?text=JD — initials in a circle, consistent across user profiles.
Skeleton route
https://fallback.pics/api/v1/animated/skeleton/400x300 — animated shimmer for loading grid states.
Thumbnail route
https://fallback.pics/api/v1/thumbnail/1200x630?text=Post+Title — labeled blog card fallback at OG dimensions.
Storybook and test fixtures
Updating Storybook stories and test fixtures
Storybook stories often contain hardcoded fakeimg URLs in the args defaults. Update these to fallback.pics URLs and the stories will continue to work without modification. The visual appearance is similar—a labeled rectangle—but the source is now a service with proper CDN headers.
Test fixtures in Jest, Vitest, or Playwright that reference fakeimg URLs should also be updated. Deterministic fallback.pics URLs are stable across test runs and do not depend on external service availability.
Resources
Placeholder API comparison and migration guides
Related posts compare other popular placeholder services and cover the migration from via.placeholder.com in detail.
https://fallback.pics/docs/
https://fallback.pics/placeholder-image-api/
https://fallback.pics/blog/best-placeholder-image-apis-for-developers/
https://fallback.pics/blog/via-placeholder-alternative-migration/ Key takeaways
What to standardize before shipping
- Fakeimg.pl is fine for local mockups but has no SLA, no CDN, and no guarantee of uptime—do not ship it to production.
- The fakeimg.pl URL format maps directly to fallback.pics with a domain change and /api/v1/ prefix.
- Use rg to find all fakeimg.pl references and bulk-replace them before deploying.
- Add a CI lint rule to prevent fakeimg.pl from reappearing after migration.
- Fallback.pics adds avatar, skeleton, blur, and thumbnail routes that fakeimg.pl does not provide.
Production fallback layer
Use fallback.pics anywhere an image URL is accepted.
Start with one deterministic URL and standardize fallback behavior across your design system.