PESDK/React Native/Guides
React Native Remove Background from Image
PhotoEditor SDK allows to quickly remove the background from pictures of people.
The background removal feature is available for any pictures or (non-animated) personal and external stickers, where a face or human body can be detected. It is supported on iOS 15+ and Android 5+.
This effect can be used to create transparent stickers, avatars, or collages:
WARNING: The background removal overlay action does not work properly on the iOS simulator. To see background properly removed on iOS please use this action on the physical device.
Adding background removal option#
✨Introduced in PhotoEditor SDK v2.15.0
To enable background removal, add CanvasAction.REMOVE_BACKGROUND
to the configuration.mainCanvasActions
property:
const configuration: Configuration = {mainCanvasActions: [CanvasAction.UNDO,CanvasAction.REDO,CanvasAction.REMOVE_BACKGROUND,],};
WARNING: To achieve the effect of transparency in exported images, make sure that your output format supports that (e.g. set
configuration.export.image.format
toImageFormat.PNG
).