Code Monkey home page Code Monkey logo

transparentify's Introduction

Transparentify

Removes the background of any image, using the PhotoRoom API.

Usage

const transparentify = require('transparentify');

// Create picture.png, with the background removed
await transparentify.run('picture.jpg');

Installation

You need a PHOTOROOM_API_KEY (request one here) available as an environment variable, or passed as an apiKey option

Options

The run method accepts an option object as the second parameters, with the following keys:

Key Description Default value
apiKey Your PhotoRoom API key PHOTOROOM_API_KEY environment variable
destination The filepath where to save the resulting file Current directory, same basename as the input, with .png extension

Command line usage

The module also comes with a transparentify command line script. Usage is as follow:

# Creates picture.png in the current directory
$ transparentify ./picture.jpg

# Creates ./dist/final.png
$ transparentify ./picture.jpg ./dist/final.png

You need a PHOTOROOM_API_KEY env variable for this to work.

Notes

Note that images created through this method are not optimized, so we recommend you minify them after creation.

transparentify's People

Contributors

pixelastic avatar renovate-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

transparentify's Issues

Dependency Dashboard

This issue contains a list of Renovate updates and their statuses.

This repository currently has no open or pending branches.


  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.