Pixfly Image Transformation lets you dynamically resize, crop, compress, and apply other transformations to your images through simple URL parameters. With just a few adjustments, you can enhance and optimize your images for various purposes, such as better web performance or visual aesthetics.
If you upload your images through the Pixfly service, you can directly transform the images using the image URL. Just add the transformation parameters at the end of the URL. For example:
$ https://thepixfly.com/api/preview?path=images/78f727.webp&w=<WIDTH>
If you want to transform an external image URL using Pixfly, you can use the following URL structure:
$ https://thepixfly.com/api/image?proj=<PROJECT_ID>&url=<IMAGE_URL>&w=<WIDTH>
Parameter | Description | Example Value |
---|---|---|
proj * | The proj parameter represents the project ID. This associates the transformation with your project. | my-project |
url * | The url parameter is the direct URL to the image you want to transform. | https://example.com/image.jpg |
w | The w parameter defines the width to resize the image to. | 800 |
h | The h parameter defines the height to resize the image to. | 600 |
q | The q parameter determines the quality of the image, with values ranging from 1 to 100. | 80 |
o | The o parameter defines the output format of the image (e.g., webp , avif ). | webp |
fc | The fc parameter applies face crop, ensuring faces are centered. | true |
smc | The smc parameter applies AI-powered smart crop to the image, optimizing for content without losing important data. | true |
t | The t parameter adds text to the image, like a watermark or caption. | Sample Text |
tbg | The tbg parameter sets the background color of the watermark text. | #000000 |
ts | The ts parameter sets the size of the watermark text. | 24 |
For security reasons, you must whitelist the domain of your website or image sources. This ensures that no unauthorized third parties can use your API key or manipulate your images.
Follow these simple steps to whitelist your domains: