Slazzer logo
Slazzer App

All-in-one AI photo editor

Get App

AI Shadow API

  • AI Shadow Generator
  • Studio Shadows
Add Studio-Quality Shadows to Images Instantly with AI Shadow API

Our AI-powered API instantly adds natural, studio-quality shadows to product images—perfect for e-commerce, marketing, and catalog visuals.

API Reference

Head
  • Server URL:
    https://api.slazzer.com/v2.0
  • Request Body:
    multipart/form-data
  • Method:
    POST
  • API:
    /ai_shadow

Authorization

  • API-KEY :
    string
  • Your API key :
    xxxx xxxx xxxx xxxx
  • Get API Key
Parameters Request body
  • source_image_file

    Type :string ($binary)

    Required :Yes

    Description :

    The source_image_file parameter is used to upload the original image on which the AI will generate and apply a realistic shadow. The shadow placement is intelligently determined based on the object’s shape, lighting position.

    Supported Format :PNG, JPG, JPEG.

    Examples :source_image_file = @/path/to/image.png

    Important :
    • 0.20 credit will be charged for each processing.
  • light_source_pos

    Type : string

    Required : Yes

    Description :

    The light_source_pos parameter defines the direction or position of the light source in the image. This influences the length and angle of the artificial shadow generated. Adjusting this value helps create more realistic lighting effects based on your scene.

    Possible Values:
    • long  : Creates a long shadow, simulating low-angle lighting (e.g., sunset).
    • short  : Creates a short shadow, simulating high-angle lighting (e.g., noon).
    • top  : Light source from the top.
    • left  : Light source from the left (default).
    Default Behavior :
    • If not specified, the default value is left.

    Example : light_source_pos = long

    Important :
    • Make sure the light direction complements the environment or background image for natural-looking results.
  • bg_color

    Type : string

    Required : No

    Description :

    The bg_color parameter sets the background color of the final image in hexadecimal format. It accepts values like 0xFFFFFF for white or 0x000000 for black. This color will appear behind the subject.

    Possible Values:
    • 0xFFFFFF : White (default)
    • 0x000000 : Black
    • 0x00FF00 : Green
    • 0xFF0000 : Red
    • 0x0000FF : Blue
    • ...and any valid 6-digit hex color code prefixed with 0x
    Default Behavior :
    • If not specified, the default background color is white (0xFFFFFF).

    Example : bg_color = 0x00FF00

    Important :
    • Ensure that the color value follows the 0xRRGGBB format without spaces or special characters.
    • This setting is useful when generating shadow-based visuals over solid-colored backgrounds.
  • shadow_opacity

    Type : float

    Required : No

    Description :

    The shadow_opacity parameter controls the transparency level of the generated shadow. A lower value makes the shadow more transparent, while a higher value makes it more visible and intense.

    Possible Values:
    • 0.1 to 1 : Controls the transparency of the shadow.
    Default Behavior :
    • If not specified, the default value is 0.5, which gives a moderately visible shadow.

    Example : shadow_opacity = 0.8

    Important :
    • Use lower values (e.g., 0.1) for subtle shadows.
    • Use higher values (e.g., 1) for darker and more pronounced shadows.
Response

Success

Background successfully removed!
Your image has been processed, and the background is now removed. You can now download or use it as you wish.

Binary image data

Error

Background removed failed!
The request could not be processed due to invalid parameters or an unsupported image format. Ensure the input image meets the required format and size specifications, then try again. (No credits were deducted for this request.)

Example :
{
    "error": "Source image file not found"
}

Error

Background removed failed!
API-KEY missing or invalid API-KEY (No credit deducted)

Example :
{
    "error": "invalid api key"
}

Error

Background removed failed!
No credits remaining (No credit deducted)

Example :
{
    "error": "No credits remaining"
}

Error

Background removed failed!
Api rate limit crossed (No credit deducted)

Example :
{
    "error": "Api rate limit crossed"
}