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 🙏

© 2024 – Pkg Stats / Ryan Hefner

snapedit-sdk

v1.0.8

Published

SDK for SnapEdit web

Downloads

474

Readme

SnapEdit SDK Package

NPM version License Issues

The SnapEdit SDK Package is a powerful and lightweight software development kit that streamlines the integration of complex functionalities into applications. Its easy-to-use API allows developers to quickly incorporate features such as background removal, object detection, object removal, and image enhancement. Designed to boost productivity, SnapEdit SDK supports various tasks, making it ideal for rapid development and deployment of image-based applications.

Features

  • 🌟 Background removal: Effortlessly remove backgrounds from images.
  • Image Enhancement: Enhances image quality, including face enhancement.
  • 🎨 Object Detection: Automatically detects objects within an image.
  • 🖌 Object Removal: Allows removal of unwanted objects with customizable masks.

Installation

You can install the SDK via npm:

npm install snapedit-sdk

Or yarn:

yarn add snapedit-sdk

Usage

Here's a quick example of how to use the SDK:

import { SnapEditSdk } from 'snapedit-sdk';

const sdk = new SnapEditSdk('YOUR_API_KEY');

// Remove background Example
async function removeBackground(imageBase64: string) {
    const response = await sdk.handleRemoveBg(imageBase64);
    console.log(response); // Image with background removed
}

// Image Enhancement Example
async function enhanceImage(imageBase64: string, zoomFactor: 2 | 4) {
    const response = await sdk.handleEnhanceImage(imageBase64, zoomFactor);
    console.log(response); // Enhanced image data URL
}

// Object Detection Example
async function detectObjects(imageBase64: string) {
    const detectionResults = await sdk.handleDetectObject(imageBase64);
    console.log(detectionResults); // Outputs detected objects and their coordinates
}

// Object Removal Example
async function removeObject(imageBase64: string, maskBase64: string) {
    const newMask = maskBase64; // Base64 encoded mask for the area to remove
    const response = await sdk.handleRemoveObject(imageBase64, newMask);
    console.log(response); // Image with object removed
}

API Documentation

SnapEditSdk(apiKey: string)

  • apiKey: Your API key from the SnapEdit platform.

handleRemoveBg(imageBase64: string): Promise<string>

Removes the background from a Base64 encoded image.

  • imageBase64: A Base64 encoded string of the image you want to remove background.

handleEnhanceImage(imageBase64: string, zoomFactor: 2 | 4): Promise<string>

Enhances the image quality by scaling up using AI techniques. Depending on the input zoomFactor, the image can be enhanced by 2x or 4x, improving clarity and detail.

  • imageBase64: A Base64 encoded string of the image you want to enhance.
  • zoomFactor: The factor by which the image should be scaled. Can be either 2 or 4.

handleDetectObject(imageBase64: string): Promise<DetectionResponse>

Detects objects within an image and returns their bounding boxes and other relevant data. Useful for applications requiring automation in object recognition and tracking.

  • imageBase64: A Base64 encoded string of the image for object detection.

handleRemoveObject(imageBase64: string, newMask: string, oldMask?: string): Promise<RemoveObjectImage>

Removes an object from the image based on a mask that defines the area to clear. This function allows for precise control over object removal, which can be tailored to specific needs such as removing unwanted items or editing image content.

  • imageBase64: A Base64 encoded string of the image from which the object is to be removed.
  • newMask: A Base64 encoded string of the mask that highlights the object to remove.
  • oldMask: Optional. A Base64 encoded string of a previous mask, if applicable, to refine the removal process.

Contributing

Contributions, issues, and feature requests are welcome!
Feel free to check the issues page if you want to contribute.

  1. Fork this repository.
  2. Create a new branch: git checkout -b feature-name.
  3. Make your changes and commit them: git commit -m 'Add feature'.
  4. Push to the branch: git push origin feature-name.
  5. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Support

For any issues, please visit the GitHub Issues page or contact us at [email protected].


Made with ❤️ by SilverAI