Background Removal

View as Markdown

Adobe ResourcesAdvancedArt TextBackground RemovalBitmapBMPBranched PipelineChannelsClipping PathsCodecsColor AdjustmentColor ConversionColor ManagementColor ProfileCompressionCropDrawingEPSEXIFExtra ChannelsFilesystemFontFormat ConversionFormatted TextGIFGradientGraphics ContainerGreen ScreenImage ValidationIndexed formatInteroperabilityIPTCJPGLossless JPEGMetadataModify ContainerMultiple framesPathPDFPersonalizationPipelinePixel AccessPNGPSDPSD ProcessorRasterizationRAWReadResizeRotateSpot ColorStreamSVGTextText LayoutTGAThumbnailTIFFTransformTransparentizeVDPVignetteWatermarkWEBPWPFWriteXMP

Remove a gradient background from a product photo

This sample shows how to cut a product out of a studio shot whose background is not a flat colour but a soft gradient, using the ContiguousBackgroundRemoval transform in a pipeline. Tolerance limits how far a background pixel may be from the background colour, while StepTolerance lets the background change gradually from pixel to pixel and stops at the sharp edge of the product. Colour differences are measured in CIE L*a*b* (delta E), so the values follow what the eye sees. The pipeline keeps memory use bounded, so the same code works for very large images.

Remove a plain background around a logo

This sample shows how to make the background of a logo or a product shot transparent with the ContiguousBackgroundRemoval transform. The background is everything that can be reached from the border of the image through pixels of similar colour, so areas of the same colour that the subject encloses stay opaque: the white letters on the badge are kept, while a colour key such as Transparentize would punch them out too. The background colour is detected automatically from the border of the image.