Effects React Native
Effects / Guides / Backgrounds / React Native

Replace a camera background in React Native with Nosmai Effects

Updated August 19, 2026

Replace the React Native camera background with a color, local image, or local video through the Nosmai API.

Prerequisites

Apply an image

if (await NosmaiCameraSdk.isAdvancedFiltersEnabled()) {
  await NosmaiCameraSdk.setBackground({
    mode: 'image',
    uri: localImageFileUri,
  });
}

Use mode: 'color' with normalized RGBA values, or mode: 'video' with a local video URI.

Portable image formats are JPEG, PNG, and WebP. Portable video formats are MP4, M4V, and MOV. Do not pass a Metro asset number, remote URL, query, or fragment.

Clear it

await NosmaiCameraSdk.clearBackground();

This clears manual segmentation. It does not remove an authored background package.

Verify it worked

The native preview should update without remounting NosmaiCameraView. Test both native platforms in Release builds.

Common errors

ErrorCauseFix
E_BACKGROUND_RESOURCEURI is unreadable or format is unsupportedCopy to a local file and use a supported extension
No visible resultPreview is not ready or capability is disabledWait for onReady and check isAdvancedFiltersEnabled
Memory rises after repeated videosPrevious resources are retained by application stateClear the background and release temporary files when finished

Next steps

References

Nosmai

An AR and AI company. Founded on the idea that the next decade of software will be visual, and that the tools for it should be within reach of anyone building.

Newsletter

Product updates and release notes. No spam.

© 2026 nosmai, inc · all rights reserved