Image Transformation

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.

Base URL Structure for Pixfly Images

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>

Base URL Structure for External Images

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>

Available Parameters

ParameterDescriptionExample 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
wThe w parameter defines the width to resize the image to.800
hThe h parameter defines the height to resize the image to.600
qThe q parameter determines the quality of the image, with values ranging from 1 to 100.80
oThe o parameter defines the output format of the image (e.g., webp, avif).webp
fcThe fc parameter applies face crop, ensuring faces are centered.true
smcThe smc parameter applies AI-powered smart crop to the image, optimizing for content without losing important data.true
tThe t parameter adds text to the image, like a watermark or caption.Sample Text
tbgThe tbg parameter sets the background color of the watermark text.#000000
tsThe ts parameter sets the size of the watermark text.24

Domain Whitelisting

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:

  1. Go to your Pixfly Dashboard.
  2. Click on the Settings tab.
  3. Under Whitelisted Domains, add your website or image source domains.
  4. Save the changes.