https://github.com/pixelastic/transparentify
Remove the background of any image, using PhotoRoom API
https://github.com/pixelastic/transparentify
opacity photoroom png transparent
Last synced: about 1 month ago
JSON representation
Remove the background of any image, using PhotoRoom API
- Host: GitHub
- URL: https://github.com/pixelastic/transparentify
- Owner: pixelastic
- License: mit
- Created: 2021-07-14T13:03:28.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2026-04-29T18:49:59.000Z (about 2 months ago)
- Last Synced: 2026-04-29T20:30:43.572Z (about 2 months ago)
- Topics: opacity, photoroom, png, transparent
- Language: JavaScript
- Homepage:
- Size: 1.3 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Transparentify
Removes the background of any image, using the [PhotoRoom][1] API.
## Usage
```javascript
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][2]) 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:
```shell
# 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.
[1]: https://www.photoroom.com/
[2]: https://dashboard.photoroom.com/accounts/signup/