Jinja templates
Render optimized product, gallery, avatar, listing, or CMS image URLs from one template filter.
Keep uploads, static files, generated previews, and object-storage media where your Flask app already exposes them. Render Skymage URLs from templates or JSON responses for exact dimensions, crops, WebP or AVIF output, and cached delivery.
from urllib.parse import urlencode
def skymage(src: str, **params: object) -> str:
return f"https://demo.skymage.net/v1/{src}?{urlencode(params)}"
@app.template_filter("skymage")
def skymage_filter(src: str) -> str:
return skymage(src, w=520, h=390, fit="cover", f="webp", q=82)
# Jinja
#
A useful Flask image optimization test starts with one public route, one uploaded or static image path, and a repeated template or JSON surface where right-sized variants are easy to compare.
Render optimized product, gallery, avatar, listing, or CMS image URLs from one template filter.
Transform public S3, R2, static, or app-served uploads without queueing new derived files.
Return predictable image variants to React, Vue, mobile, admin, or dashboard clients from Flask responses.
Use one template filter or response helper, then test a single list, detail, upload, or preview route before changing broader media handling.
def card_image(path: str) -> str:
return skymage(
path,
w=520,
h=390,
fit="cover",
f="webp",
q=82,
)
return jsonify(items=[{"image_url": card_image(item.image_path)} for item in items])
Can Skymage transform the public upload, static, or storage URLs your Flask app already renders?
Can repeated Jinja templates request exact dimensions instead of rendering originals everywhere?
Can routes ship WebP or AVIF without adding Pillow jobs, queues, or derived-file storage?
Can one route prove bytes, cache, and visual fit before a broader media pipeline change?
Send one public Flask-backed page or endpoint. Skymage will identify the repeated image surface to test first, the URL parameters to try, and whether the current upload or static media origin fits a low-risk rollout.
Create a Skymage CDN URL, prepend it to your existing image URLs, and let the edge handle optimization, transforms, and delivery.
No credit card required. 14-day free trial.