Cloudflare Images – New in Images: text rasterization and updates to the binding

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, and color options.
  • The draw array in cf.image now accepts a text key.

Manage hosted images without an API token.

  • Metadata filtering: Pass filter.metadata to .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 headers option to .response() to set headers without rebuilding the Response.
  • Content-Type is always taken from the optimized image and can’t be overridden by a specified header.
  • Set Cache-Control with 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.

Source: Cloudflare

Share This Update