GET
/
transform

How to use

The upscale transformation allows you to increase the resolution of an image to specified dimensions.

Pass the following query params to the API endpoint:

upscale=true&w=width&h=height

For example: upscale=true&w=1000&h=800

Parameters

  • upscale: Set this parameter to true to enable upscaling.
  • w: The target width for upscaling.
  • h: The target height for upscaling.

Effect of Upscaling

  • When upscale=true is used with w and/or h parameters, the image will be enlarged to the specified dimensions.
  • If only w or h is provided, the other dimension will be calculated to maintain the original aspect ratio.
  • Upscaling can potentially reduce image quality if the enlargement is significant.

This transformation is useful when you need to ensure that all images in a gallery or layout have consistent dimensions, even if some original images are smaller than the desired size.

Original Image (500px width)

URL : https://www.thunderimage.com/sample/small-image.jpg

Upscaled Image (1000px width)

URL: /transform?url=https://www.thunderimage.com/sample/small-image.jpg&upscale=true&w=1000

Best Practices

  • Use upscale judiciously, as enlarging images beyond their original resolution can lead to loss of quality or pixelation.
  • Consider the maximum dimensions you’ll need and set your w and h values accordingly.
  • For best results, use upscale with images that are only slightly smaller than your target dimensions.
  • Be aware of the potential increase in file size when upscaling images.
  • If possible, use higher quality source images to minimize quality loss during upscaling.
  • Consider using additional transformations like sharpening to enhance upscaled images.
  • When maintaining aspect ratio is crucial, provide only one of w or h to let the system calculate the other dimension automatically.

Notes

  • The upscale parameter must be set to true for the upscaling to take effect.
  • When used without w or h parameters, upscale=true will allow the image to be enlarged to fit within the dimensions specified by other transformations (e.g., fit-in).
  • If the provided w and h are smaller than the original image dimensions, the image will be downscaled instead.
  • Upscaling is performed using advanced algorithms to minimize quality loss, but some degradation may still occur, especially with significant enlargements.

Authorizations

x-api-key
string
headerrequired

API key required for authentication

Query Parameters

url
string
required

The URL of the image to be transformed.

fit-in
string

Specifies the dimensions to fit the image into. Required for upscale to have an effect.

upscale
boolean
default: false

Enables upscaling of the image when used with fit-in.

Response

200 - image/jpeg

The transformed image in JPEG format.