# transparentify

> Removes the background of any image, using the [PhotoRoom][1] API.

Latest version **0.1.0** (published 2021-07-14) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install transparentify
pnpm add transparentify
yarn add transparentify
bun add transparentify
```

Provides the command `0`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2021-07-14 |
| First published | 2021-07-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=14.17.0 |
| Dependencies | 4 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | pixelastic |

## Links

- npm: https://www.npmjs.com/package/transparentify
- npm.io page: https://npm.io/package/transparentify

## Dependencies (4)

- [firost](https://npm.io/package/firost.md) 2.16.2
- [golgoth](https://npm.io/package/golgoth.md) 2.0.0
- [fs-extra](https://npm.io/package/fs-extra.md) 10.0.0
- [form-data](https://npm.io/package/form-data.md) 4.0.0

## Recent versions

- 0.1.0 (latest) — 2021-07-14
- 0.0.3 — 2021-07-14
- 0.0.2 — 2021-07-14

## 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/

---
_Source: https://npm.io/package/transparentify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
