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

@nitro-mlkit/subject-segmentation

v0.1.0-beta.0

Published

High-performance on-device subject segmentation for React Native — Google ML Kit + Nitro. Cut out the main subject(s) of a photo as a transparent PNG, zero bridge overhead. Android-only.

Downloads

29

Readme

React Native ML Kit — Subject Segmentation

@nitro-mlkit/subject-segmentation · on-device Google ML Kit via Nitro Modules — JSI, no bridge.

⚠️ Beta (0.1.0-beta.x). Android-only. Native path verified on-device; the full run needs the Google Play optional model, which downloads on first use (slow on emulators). See Platform status.

High-performance, on-device subject segmentation for React Native, built with Nitro Modules (JSI, no bridge).

Powered by Google ML Kit. Cuts out the main subject(s) of a photo from the background and returns a transparent PNG cutout. Downloads a small model at runtime on first use, then runs entirely on-device — no network.

Installation

npm install @nitro-mlkit/subject-segmentation react-native-nitro-modules

No config plugin (autolinked Expo module). Install and npx expo prebuild. Not available in Expo Go.

Usage

import { NitroSubjectSegmenter } from "@nitro-mlkit/subject-segmentation";

const { foregroundUri, width, height, subjectCount } =
  await NitroSubjectSegmenter.segment(imageUri);
// foregroundUri -> a PNG cutout of the subject(s) with a transparent
// background; render it, composite it, or save it.

NitroSubjectSegmenter.isAvailable(); // true on Android, false elsewhere

SubjectSegmentationResult

| field | type | notes | | ----- | ---- | ----- | | foregroundUri | string | file:// uri of a transparent PNG cutout of the subject(s) | | width | number | cutout width in pixels | | height | number | cutout height in pixels | | subjectCount | number | number of distinct subjects found |

Notes

  • First call downloads a model. ML Kit fetches the subject-segmentation model on first use; that call is slower and needs connectivity. Subsequent calls are fully on-device.
  • Beta ML Kit dependency. Uses com.google.mlkit:segmentation-subject (currently a beta artifact).

Platform status

| Platform | Min | Status | | -------- | --- | ------ | | Android | API 26+ | ⚙️ Native path verified (Pixel 9, API 36); full result pending Google Play optional-model download (slow on emulator — validate on a real device) | | iOS | — | ❌ Not supported — Google ML Kit has no Subject Segmentation API on iOS |

isAvailable() returns false on iOS and segment() rejects there, so you can call it safely from cross-platform code and gate on the result.

Part of nitro-mlkit

The full ML Kit suite on Nitro — see the other @nitro-mlkit/* packages.

License

MIT © Gonzalo Polo