npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jacobjmc/react-native-background-remover

v1.0.2

Published

Enhanced React Native package for removing backgrounds from images containing people, objects, animals, and more using Apple's Vision framework

Readme

react-native-background-remover

Note: This is a fork of atlj/react-native-background-remover with enhanced features and expanded object detection capabilities.

Enhanced React Native package that uses MLKit on Android and Apple's Vision framework on iOS to remove backgrounds from images containing people, objects, animals, and more.

Installation

yarn add @jacobjmc/react-native-background-remover

Usage

import { removeBackground } from '@jacobjmc/react-native-background-remover';

// You can get the imageURI from the camera or the gallery.
const backgroundRemovedImageURI = removeBackground(imageURI);

Features

Enhanced Object Support

  • iOS 17.0+: Remove backgrounds from any foreground objects including:

    • 👥 People (single or multiple)
    • 🚗 Vehicles (cars, motorcycles, bicycles)
    • 🐕 Animals (pets, wildlife)
    • 🪑 Furniture (chairs, tables, lamps)
    • 📱 Electronics (phones, laptops, appliances)
    • 🍎 Food items and other objects
  • iOS 15.0-16.x: People-only background removal (maintains original functionality)

🔄 Backward Compatibility

  • Same API interface - no code changes required
  • Automatic iOS version detection and appropriate API selection
  • Graceful fallback for older iOS versions

🎯 Smart Detection

  • Combines multiple detected objects into a single result
  • Handles complex scenes with people and objects together
  • High-quality edge detection for fine details (hair, fur, complex edges)

Platform Support

iOS: You need to use a real device on iOS to use this package. Otherwise, it will throw a warning and return the original image. You can still use an emulator on Android.

iOS Version Requirements:

  • iOS 17.0+: Full object segmentation (people, cars, animals, furniture, etc.)
  • iOS 15.0-16.x: People-only segmentation
  • iOS 14.x and below: Not supported

Android: Uses MLKit for background removal (emulator supported)

Error Handling

The package provides detailed error messages for different scenarios:

try {
  const result = await removeBackground(imageURI);
  // Success - result contains the processed image URI
} catch (error) {
  console.log(error.code, error.message);
  // Error codes:
  // 1: iOS version too old (< iOS 15)
  // 2: Running on iOS simulator (not supported)
  // 3: Invalid image URI
  // 4: Unable to load image
  // 5: No people detected (iOS 15-16 only)
  // 6: Error creating final image
  // 7: Error saving processed image
  // 8: Failed to generate combined mask (iOS 17+)
  // 9: No foreground objects detected (iOS 17+)
}

Technical Details

iOS Implementation

  • iOS 17.0+: Uses VNGenerateForegroundInstanceMaskRequest for general object segmentation
  • iOS 15.0-16.x: Uses VNGeneratePersonSegmentationRequest for people-only segmentation
  • Output: PNG format with transparency preservation
  • Processing: Combines multiple detected objects into unified mask

Android Implementation

  • Uses MLKit for background removal
  • Supports both emulator and real devices

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library