Format
Specifies the output format of the image.
How to use
The format transformation allows you to convert the image to a different file format.
Pass the following query param to the API endpoint:
format=desired_format
Where:
desired_format
is the format you want to convert the image to.
For example: format=webp
Parameter
format
: The desired output format for the image. This parameter accepts the following values:
- jpeg
- png
- gif
- webp
- tiff
- avif
- jp2 (JPEG 2000)
Effect of Format Transformation
- Converts the image to the specified file format.
- Can affect file size, image quality, and compatibility with different systems or browsers.
- May change support for features like transparency or animation, depending on the chosen format.
This transformation is useful for optimizing images for specific use cases, such as reducing file size for web delivery or ensuring compatibility with certain systems.
Original Image (JPEG)
URL : https://www.thunderimage.com/sample/yosemite.jpg
Image Converted to WebP
URL: /transform?url=https://www.thunderimage.com/sample/yosemite.jpg&format=webp
Best Practices
- Use JPEG for photographs and complex images with many colors.
- Use PNG for images that require transparency or have large areas of solid colors.
- Use WebP for web delivery when targeting modern browsers, as it often provides better compression than JPEG or PNG.
- Use GIF for simple animations.
- Use TIFF for high-quality print graphics.
- Use AVIF for web delivery when targeting the most up-to-date browsers, as it offers excellent compression and quality.
- Use JPEG 2000 (jp2) for high-quality imaging in specialized fields like medical imaging or when targeting systems that support this format.
Note
When converting between formats, be aware of the strengths and limitations of each format:
- Converting from a lossy format (like JPEG) to a lossless format (like PNG) will not recover any quality lost in the original compression.
- Converting to a format that doesn’t support transparency (like JPEG) from one that does (like PNG) will result in the loss of transparency information.
- Some formats (like GIF) have limited color palettes, which may affect image quality for complex images.
Authorizations
API key required for authentication
Query Parameters
The URL of the image to be transformed.
The desired output format for the image.
jpeg
, png
, gif
, webp
, tiff
, avif
, jp2
Response
The transformed image in JPEG format.