Upscale
Upscales the image to specified dimensions.
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 totrue
to enable upscaling.w
: The target width for upscaling.h
: The target height for upscaling.
Effect of Upscaling
- When
upscale=true
is used withw
and/orh
parameters, the image will be enlarged to the specified dimensions. - If only
w
orh
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
andh
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
orh
to let the system calculate the other dimension automatically.
Notes
- The
upscale
parameter must be set totrue
for the upscaling to take effect. - When used without
w
orh
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
andh
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
API key required for authentication
Query Parameters
The URL of the image to be transformed.
Specifies the dimensions to fit the image into. Required for upscale to have an effect.
Enables upscaling of the image when used with fit-in.
Response
The transformed image in JPEG format.