Image enhancement

Image enhancement API

Auto-enhance, perspective correction, sky replacement, and blurring — endpoints for cleaning up real estate photos.

The image enhancement endpoints fix common listing photo issues: dull lighting, tilted perspective, gray skies, and privacy-sensitive content. Each accepts an image URL and returns the processed result.

Auto-enhance

POST/api/enhance

Automatically improves lighting, color balance, sharpness, and contrast. Use this as the default cleanup pass on raw listing photos.

Image enhancement examples
Real listing photos before and after the enhance pass — dim rooms, dull color, soft focus.
See examples →

Parameters

apiKeystringrequired
Your API key.
imageUrlstringrequired
URL of the photo to enhance, or a base64 data URI.
highFidelityboolean
Non-generative enhancement: adjusts only light and sharpness, keeping colors, materials, object sizes, and framing exactly as in the original photo. Best when the result must faithfully match the original.
Default: false
preserveAspectRatioboolean
By default, the output comes back at whatever size the AI model produces, which may not match the aspect ratio or resolution of your photo. Set to true to get the result at the exact width and height of the input image: it is center-cropped to the original aspect ratio (never stretched) and resized to the original resolution.
Default: false
propertyIdstring
Optional id of the property (from list_properties or create_property) this photo belongs to. When set, the result is saved into that property's gallery — visible and editable from the app — instead of only returned as a URL. The response then also includes <code>source</code> (<code>imageId</code> and <code>name</code>) of the original photo, when it is already in that property or you also send <code>name</code>.
namestring
Optional name for the original photo (e.g. its file name), up to 200 characters. Requires <code>propertyId</code>. If the photo isn't in that property yet, it's saved there under this name in the same call, so you don't need <code>add_images_to_property</code> first, and it comes back as <code>source.name</code>. A photo already in the property keeps its name. Never shown on the image.

Example request

curl -X POST https://app.pedra.ai/api/enhance \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "YOUR_API_KEY",
    "imageUrl": "https://example.com/listing-photo.jpg",
    "highFidelity": true
  }'

Example response

JSON
{
  "message": "Success",
  "output": [
    { "url": "https://img.pedra.ai/<generated-id>" }
  ]
}

Response time: ~10 seconds per image. The response can include multiple URLs when the model produces variants.

Enhance + correct perspective

POST/api/enhance_and_correct_perspective

Same as /api/enhance but with an upstream perspective-warp pass that straightens vertical lines. Use it when listing photos were shot with a phone tilted up or down.

Image enhancement examples
Same gallery as /api/enhance — perspective correction is most visible on tilted exterior shots.
See examples →

Parameters

apiKeystringrequired
Your API key.
imageUrlstringrequired
URL of the photo, or a base64 data URI.
highFidelityboolean
Non-generative enhancement plus perspective correction: adjusts only light, sharpness, and perspective, keeping colors, materials, and object sizes exactly as in the original.
Default: false
preserveAspectRatioboolean
By default, the output comes back at whatever size the AI model produces, which may not match the aspect ratio or resolution of your photo. Set to true to get the result at the exact width and height of the input image: it is center-cropped to the original aspect ratio (never stretched) and resized to the original resolution.
Default: false
propertyIdstring
Optional id of the property (from list_properties or create_property) this photo belongs to. When set, the result is saved into that property's gallery — visible and editable from the app — instead of only returned as a URL. The response then also includes <code>source</code> (<code>imageId</code> and <code>name</code>) of the original photo, when it is already in that property or you also send <code>name</code>.
namestring
Optional name for the original photo (e.g. its file name), up to 200 characters. Requires <code>propertyId</code>. If the photo isn't in that property yet, it's saved there under this name in the same call, so you don't need <code>add_images_to_property</code> first, and it comes back as <code>source.name</code>. A photo already in the property keeps its name. Never shown on the image.

Response shape: same as /api/enhance (array). Response time: ~15 seconds per image.

Sky replacement

POST/api/sky_blue

Replace a gray, overcast, or washed-out sky and improve the lighting. Defaults to a clean blue sky; use skyStyle to pick a different time of day (sunrise, sunset, night).

Image enhancement examples
Overcast exteriors turned into clean blue-sky listing photos.
See examples →

Parameters

apiKeystringrequired
Your API key.
imageUrlstringrequired
URL of the exterior photo, or a base64 data URI.
skyStylestring
Which sky and lighting to apply. Defaults to "sunny". Options: "sunny" (bright clear blue sky), "sunny-no-reflections" (blue sky with soft, even light — ideal for shaded or north-facing exteriors), "sunrise" (warm golden morning), "dawn" (sunset / dusk tones), "night" (twilight with warm interior and facade lighting).
Values: sunny sunny-no-reflections sunrise dawn night
Default: sunny
preserveAspectRatioboolean
By default, the output comes back at whatever size the AI model produces, which may not match the aspect ratio or resolution of your photo. Set to true to get the result at the exact width and height of the input image: it is center-cropped to the original aspect ratio (never stretched) and resized to the original resolution.
Default: false
propertyIdstring
Optional id of the property (from list_properties or create_property) this photo belongs to. When set, the result is saved into that property's gallery — visible and editable from the app — instead of only returned as a URL. The response then also includes <code>source</code> (<code>imageId</code> and <code>name</code>) of the original photo, when it is already in that property or you also send <code>name</code>.
namestring
Optional name for the original photo (e.g. its file name), up to 200 characters. Requires <code>propertyId</code>. If the photo isn't in that property yet, it's saved there under this name in the same call, so you don't need <code>add_images_to_property</code> first, and it comes back as <code>source.name</code>. A photo already in the property keeps its name. Never shown on the image.

Example request

curl -X POST https://app.pedra.ai/api/sky_blue \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "YOUR_API_KEY",
    "imageUrl": "https://example.com/exterior-photo.jpg",
    "skyStyle": "sunny"
  }'

Example response

JSON
{
  "message": "Success",
  "output": {
    "url": "https://img.pedra.ai/<generated-id>"
  }
}

Response time: ~10 seconds per image. Note: output is a single object here, not an array.

Blur objects

POST/api/blur

Auto-blurs sensitive content like faces, license plates, or branded logos. Useful for portal-compliant exterior shots.

Parameters

apiKeystringrequired
Your API key.
imageUrlstringrequired
URL of the source photo.
objectsToBlurstringrequired
Comma-separated list of what to blur. Examples: "faces", "license plates", "logos", "faces, license plates".
preserveAspectRatioboolean
By default, the output comes back at whatever size the AI model produces, which may not match the aspect ratio or resolution of your photo. Set to true to get the result at the exact width and height of the input image: it is center-cropped to the original aspect ratio (never stretched) and resized to the original resolution.
Default: false
propertyIdstring
Optional id of the property (from list_properties or create_property) this photo belongs to. When set, the result is saved into that property's gallery — visible and editable from the app — instead of only returned as a URL. The response then also includes <code>source</code> (<code>imageId</code> and <code>name</code>) of the original photo, when it is already in that property or you also send <code>name</code>.
namestring
Optional name for the original photo (e.g. its file name), up to 200 characters. Requires <code>propertyId</code>. If the photo isn't in that property yet, it's saved there under this name in the same call, so you don't need <code>add_images_to_property</code> first, and it comes back as <code>source.name</code>. A photo already in the property keeps its name. Never shown on the image.

Example request

curl -X POST https://app.pedra.ai/api/blur \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "YOUR_API_KEY",
    "imageUrl": "https://example.com/photo.jpg",
    "objectsToBlur": "faces, license plates"
  }'

Example response

JSON
{
  "message": "Success",
  "output": {
    "url": "https://img.pedra.ai/<generated-id>"
  }
}

Response time: ~10 seconds per image. output is a single object.

Next

See Virtual staging for furniture and content edits, or Create video for generating listing videos from photos.