Feature
Text rasterization and updates to the Images binding
Cloudflare Images now supports text rasterization to render text into images with customizable styling, metadata filtering to manage hosted images, server-side signing for private image URLs, and direct creator uploads. The Images binding also adds header management and improved caching options.
We've added more ways to manage and manipulate images with the Images binding. Here's what's new:
Render text into an image. Output a string of text into its own image or draw it over another image.
- Use the
.text()method to rasterize text with the Images binding. - Style content using the
font,size, andcoloroptions. - The
drawarray incf.imagenow accepts atextkey.
Manage hosted images without an API token.
- Metadata filtering: Pass
filter.metadatato.list()to return images by custom metadata. Match a bounded range by setting two operators in one condition, for example,priority: { gte: 2, lte: 5 }. - Server-side signing: Get a signed URL for a private image with
.signedUrl(). - User uploads: Create a Direct Creator Upload link with
.createDirectUpload()so that a client can upload an image to your storage.
Set headers in a single call.
- Pass a
headersoption to.response()to set headers without rebuilding theResponse. Content-Typeis always taken from the optimized image and can't be overridden by a specified header.- Set
Cache-Controlwith Workers Cache to cache your optimized image at the edge.
For more information, refer to Optimize with Workers, Draw overlays and watermarks, and Manage hosted images with Workers.
imagesapitext-renderingcloudflare-workersimage-optimization
Source: original entry ↗