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

architram-smart-fill-segmentation

v0.1.1

Published

Fill Segmentation

Downloads

165

Readme

Smart Fill Segmentation for Expo & React Native

A high-performance React Native / Expo Native Module for "Smart Region Filling" (flood fill based image segmentation).

Ever wanted a "magic wand" tool or "paint bucket fill" that constraints shapes within an image? This module provides exactly that. It runs an optimized native algorithm directly on the device memory to process complex images and generate scalable SVG path masks in milliseconds.

Features

  • True Native Implementation: Written in Kotlin with memory-safe coroutine concurrency via Dispatchers.Default.
  • Intelligent Edge Tracing: Uses flood filling and Moore-Neighbor edge tracking to export the closed boundary of an object automatically.
  • Expo Friendly: Operates as a pure Expo plugin. Easy to drop into any managed workflow app!
  • Works offline: Does not require hefty AI models. It runs purely on mathematical pixel similarity calculation.

Installation

npm install architram-smart-fill-segmentation

Quick Start

import { getSmartFillMask } from "architram-smart-fill-segmentation";
import type { SmartFillConfig } from "architram-smart-fill-segmentation";

async function handleTapOnImage(x: number, y: number, imageLocalUri: string) {
  try {
    const config: SmartFillConfig = {
      imageUri: imageLocalUri, // Must be a local `file://` URI
      startX: Math.floor(x),   // X pixel coordinate of touch point against origin image resolution
      startY: Math.floor(y),   // Y pixel coordinate of touch point against origin image resolution
      tolerance: 20            // Default is 20, up it for wider selection (0-255).
    };
    
    // Returns a raw SVG path string "M 10 10 L ... Z"
    const svgPathMask = await getSmartFillMask(config);
    
    console.log("Segment Boundary Path:", svgPathMask);
  } catch (error) {
    console.error("Failed to generate segmentation mask.", error);
  }
}

API

getSmartFillMask(config: SmartFillConfig): Promise<string>

Returns a Promise that yields a calculated SVG path <Path d="..." /> string for the connected color region clicked upon. If no valid path was found, it returns "" empty string.

SmartFillConfig Configuration

| Property | Type | Required | Description | | --------- | -------- | -------- | ------------------------------------------------------------ | | imageUri| string | Yes | Internal file:/// location of the fully downloaded image. | | startX | number | Yes | The x coordinate starting seed pixel (unzoomed image coord). | | startY | number | Yes | The y coordinate starting seed pixel (unzoomed image coord). | | tolerance| number | Optional | Color variance threshold integer value (0 - 255). 20 Default.|

Use-cases

  • Interactive Coloring Book constraints.
  • Background removal (invert selection path mask).
  • Smart touch magic wand tooling.

Support & Contributions

Feel free to open an issue or pull request!