Background
Imgix provides two ways to modify image backgrounds. The AI-powered parameters work on any background: you can remove one entirely to isolate a subject, replace it with generated scenery from a text prompt, or combine both with modifiers like shadow generation, foreground type hints, and model selection. The colorkey family instead keys out one known color, which is faster and is billed as a standard render.
Background Removal
The bg-remove parameter detects the primary subject in an image and removes its background, returning a transparent PNG. Use bg-remove-model to select from multiple AI providers, bg-remove-add-shadow to add an AI-generated shadow beneath the subject, and bg-remove-fg-type to provide a subject type hint for improved accuracy. The bg parameter can be combined with bg-remove to replace the transparent area with a solid color.
Loading images...
Background Replacement
The bg-replace parameter identifies the subject in an image and replaces the background with AI-generated content based on a text prompt. Use bg-replace-neg-prompt to exclude unwanted elements from the generated scene, and bg-replace-fallback to control behavior when replacement fails.
Color Key
The colorkey parameter makes every pixel near a chosen color transparent. Unlike bg-remove, it does no subject detection — it keys a single known color, so it suits solid studio backgrounds such as white behind a product shot, and runs at the speed of any other rendering parameter.
Use colorkey-tol to set how close a color must be to the key, colorkey-feather to soften the resulting edge, colorkey-defringe to strip leftover key color from the subject’s edges, and colorkey-mode to switch between full RGB matching and a brightness-independent chroma match for green and blue screens.



