GET
/
transform

How to use

The fill transformation allows you to fill missing areas or transparent parts of an image with a specified color or effect.

Pass the following query param to the API endpoint:

fill=color

Where:

  • color is the color or effect to fill the missing or transparent areas.

For example: fill=red or fill=FF0000 or fill=blur

Parameter

fill: Specifies the color or effect to use for filling. This parameter accepts the following values:

  • Color name (e.g., “red”, “blue”, “green”)
  • Hexadecimal RGB expression without the ”#” character (e.g., “FF0000” for red)
  • Special keywords:
    • “blur”: Fills missing parts with a blurred version of the original image
    • “auto”: Uses the top-left image pixel color as the filling color
    • “none”: Makes the filling fully transparent

Effect of Fill Transformation

  • Fills missing areas or transparent parts of an image with the specified color or effect.
  • Useful for ensuring consistent image dimensions or backgrounds, especially when working with transparent images.
  • Can create interesting visual effects, particularly with the “blur” option.

This transformation is particularly useful when you need to standardize image backgrounds or create specific visual effects with partially transparent images.

Original Image

URL : https://www.thunderimage.com/sample/yosemite.png

Image with Red Fill

URL: /transform?url=https://www.thunderimage.com/sample/yosemite.png&fill=red

Image with Blur Fill

URL: /transform?url=https://www.thunderimage.com/sample/yosemite.png&fill=blur

Best Practices

  • Use named colors or hexadecimal values for precise color control.
  • The “blur” option can create an interesting backdrop effect, especially for logos or product images.
  • Use “auto” when you want the background to blend seamlessly with the image content.
  • When working with transparent PNGs, consider how the fill color will interact with partially transparent areas.
  • If you need to maintain transparency in some areas while filling others, consider using “none” and then applying additional transformations.

Note

The fill transformation affects only the transparent or missing parts of an image. It does not change the existing visible content of the image. When using “blur”, the effect may vary depending on the original image content and the amount of transparency. If the image doesn’t have transparent areas, the fill transformation may not have a noticeable effect.

Authorizations

x-api-key
string
headerrequired

API key required for authentication

Query Parameters

url
string
required

The URL of the image to be transformed.

fill
enum<string>

The color or effect to fill missing or transparent areas. Can be a color name, hexadecimal RGB value (without #), or special keywords.

Available options:
red,
blue,
green,
FF0000,
blur,
auto,
none

Response

200 - image/jpeg

The transformed image in JPEG format.