Bria Product Shadow

Bria Product Shadow enhances product images with realistic shadows for professional eCommerce presentations.


API

If you're looking for an API, you can choose from your desired programming language.

POST
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 import requests import base64 # Use this function to convert an image file from the filesystem to base64 def image_file_to_base64(image_path): with open(image_path, 'rb') as f: image_data = f.read() return base64.b64encode(image_data).decode('utf-8') # Use this function to fetch an image from a URL and convert it to base64 def image_url_to_base64(image_url): response = requests.get(image_url) image_data = response.content return base64.b64encode(image_data).decode('utf-8') # Use this function to convert a list of image URLs to base64 def image_urls_to_base64(image_urls): return [image_url_to_base64(url) for url in image_urls] api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/bria-product-shadow" # Request payload data = { "image_url": "https://segmind-resources.s3.amazonaws.com/input/a146bc0b-0223-444b-850b-08271689e74e-bae580eab92a46be381d5d16e53a82c9.jpeg", "type": "regular", "background_color": "#8C92AC", "shadow_color": "#000000", "shadow_intensity": 75, "preserve_alpha": True } headers = {'x-api-key': api_key} response = requests.post(url, json=data, headers=headers) print(response.content) # The response is the generated image
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


skustr ( default: 1 )

Unique SKU identifier for product. Example: 'SKU12345'.


image_urlstr ( default: https://segmind-resources.s3.amazonaws.com/input/a146bc0b-0223-444b-850b-08271689e74e-bae580eab92a46be381d5d16e53a82c9.jpeg )

URL for product image with transparent background. Example: use 'png' for optimal results.


typeenum:str ( default: regular )

Choose shadow style: 'regular' or 'float'. Use 'float' for 3D effect.

Allowed values:


background_colorstr ( default: #8C92AC )

Background color for image as hex code. Use '#FFFFFF' for white background.


shadow_colorstr ( default: #000000 )

Set shadow color using hex code. Example: '#000000' for black shadow.


shadow_intensityint ( default: 75 )

Control shadow darkness, 0 to 100. Example: '75' for darker shadow.

min : 0,

max : 100


shadow_blurint ( default: 15 )

Adjust shadow blur edges. '10' for sharper look.


shadow_widthint ( default: 1 )

Set shadow width in pixels. Example: '100' for more width.


shadow_heightint ( default: 80 )

Control shadow height, in pixels. Example: '80' for more height.


force_rmbgboolean ( default: 1 )

Remove background even if alpha exists. Use 'true' to force.


preserve_alphaboolean ( default: true )

Keep transparency from input image. Set 'false' to discard.


content_moderationboolean ( default: 1 )

Check for inappropriate content. Use 'true' for screening.

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Resources to get you started

Everything you need to know to get the most out of Bria Product Shadow

# Guide: Using the Product Shadow Model Effectively

This guide walks you through the key parameters and best-practice settings for different scenarios when generating product shadows. Adjust these settings to achieve consistent, high-quality results.

---

## 1. Core Parameters

- **image_url** (required): URL of your transparent-background PNG.
- **sku** (optional): Unique product code (e.g. “SKU12345”).
- **type**: Shadow style.  
  - `regular` (default) – subtle, natural drop shadows.  
  - `float` – pronounced 3D effect with offset shadow.
- **background_color**: Canvas color in HEX (e.g. `#FFFFFF`).
- **shadow_color**: Shadow HEX code (e.g. `#000000`).
- **shadow_intensity**: Darkness level (0–100).  
- **shadow_blur**: Edge softness in pixels.  
- **shadow_width` & `shadow_height`:** Shadow size in pixels (x/y offset).
- **force_rmbg**: Remove background even if image has alpha.  
- **preserve_alpha**: Keep input transparency (`true` by default).  
- **content_moderation**: Flag for inappropriate content screening.

---

## 2. Use Cases & Recommended Settings

### A. eCommerce — Clean Product Shots
- type: `regular`  
- background_color: `#FFFFFF`  
- shadow_color: `#000000`  
- shadow_intensity: `50`  
- shadow_blur: `15`  
- shadow_width: `80`, shadow_height: `50`  
- preserve_alpha: `true`  
Result: Consistent, natural drop shadows on white background for catalogs.

### B. Premium 3D “Floating” Effect
- type: `float`  
- background_color: `#FFFFFF`  
- shadow_color: `#000000`  
- shadow_intensity: `75`  
- shadow_blur: `30`  
- shadow_width: `200`, shadow_height: `200`  
- preserve_alpha: `true`  
Result: Eye-catching product “pop” for hero banners or landing pages.

### C. Dark-Mode or Black Background
- type: `regular`  
- background_color: `#000000`  
- shadow_color: `#FFFFFF`  
- shadow_intensity: `60`  
- shadow_blur: `20`  
- shadow_width: `100`, shadow_height: `60`  
- preserve_alpha: `true`  
Result: White/gray shadows stand out against dark themes.

### D. Social Media / Lifestyle Posts
- type: `float`  
- background_color: `#F5F5F5` or brand color  
- shadow_color: `#000000`  
- shadow_intensity: `65`  
- shadow_blur: `25`  
- shadow_width: `120`, shadow_height: `120`  
- preserve_alpha: `true`  
Result: Stylized, consistent product overlays on varied backgrounds.

---

## 3. Advanced Tips

1. **force_rmbg**: Enable when input PNG has unwanted artifacts—ensures pristine background removal.  
2. **preserve_alpha = false**: Use if you want to flatten transparency for composite workflows.  
3. **content_moderation**: Turn on for user-generated images to enforce brand safety.

By tuning these parameters per use case, you can automate high-quality shadow generation, maintain visual consistency, and streamline your e-commerce, marketing, or social media pipelines. Happy styling!

Other Popular Models

Discover other models you might be interested in.

Cookie settings

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept all", you consent to our use of cookies.