# Chroma Key: Green Screen to Transparent PNG > Key out a green or blue screen into a transparent PNG with spill suppression. Removes a green, blue or any strongly coloured backing from a photo with a colour-difference keyer, un-mixes the backing colour from soft edges, suppresses spill and returns an RGBA PNG plus the matte. The screen colour is picked from the image border automatically or entered as HEX. Part of usefulweb.app (https://usefulweb.app/). Part of [Lumina](https://lumina.usefulweb.app/) (ownerApp: lumina). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://luminachromakey.usefulweb.app/ (interactive tool at https://luminachromakey.usefulweb.app/tool) - JSON API: POST https://luminachromakey.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://luminachromakey.usefulweb.app/api/v1/tool) - OpenAPI: https://luminachromakey.usefulweb.app/openapi.json - MCP (Streamable HTTP): https://luminachromakey.usefulweb.app/mcp - tool `lumina_chroma_key` ## Inputs - image (file, required): Photo in front of a screen (PNG, JPEG or WebP, up to 2 megapixels) - key (text): Screen colour (HEX, or auto = median of the border) - gain (number): Screen gain - Above 1 removes more of the screen (also from greenish foreground); below 1 keeps more. - clipBlack (number): Clip black - Matte values below this become fully transparent (cleans noisy screens). - clipWhite (number): Clip white - Matte values above this become fully opaque (fills holes in the subject). - spill (number): Spill suppression - balance (number): Red/blue balance - Weight of the first other channel in the colour difference (red for green and blue screens). - shrink (integer): Shrink matte (px) - matteBlur (number): Soften matte edge (px) ## Method - Colours are decoded to linear light. The matte is a balanced colour difference m(C) = C_dominant − (b·C_other1 + (1 − b)·C_other2) of the screen colour’s dominant channel, and α = 1 − gain·m(C)/m(screen), remapped between clip black and clip white. - For a foreground mixed with the screen, C = α·F + (1 − α)·K, the matte is linear in α, so α is recovered exactly for foreground colours with m(F) = 0 (greys, whites, many skin tones) and clamped for others. The screen colour is then removed from edge pixels (premultiplied α·F = C − (1 − α)·K) and remaining spill is limited to the balanced mix of the other channels. - Optional shrink (square erosion) and edge softening (Gaussian) act on the matte. Same engine as the Chroma key node in Lumina’s Compositor. ## Limits - Colour-difference keying needs an evenly lit screen; strongly green or blue foreground objects become partly transparent. For general photos without a screen use the background remover instead.