Socket
Socket
Sign inDemoInstall

remove.bg

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remove.bg - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

6

dist/index.d.ts

@@ -11,2 +11,7 @@ interface RemoveBgOptions {

size?: "regular" | "medium" | "hd" | "4k";
/**
* Help the API a little by telling the type of image you want to extract the background from.
* Defaults to "auto".
*/
type?: "auto" | "person" | "product";
outputFile?: string;

@@ -26,2 +31,3 @@ }

creditsCharged: number;
detectedType: "product" | "person";
resultWidth: number;

@@ -28,0 +34,0 @@ resultHeight: number;

8

dist/index.js

@@ -21,3 +21,4 @@ "use strict";

"image_url": options.url,
"size": options.size || "regular"
"size": options.size || "regular",
"type": options.type || "auto"
})

@@ -33,2 +34,3 @@ .end(result => processResult(result, options, resolve, reject));

.field("size", options.size || "regular")
.field("type", options.type || "auto")
.attach("image_file", fs.createReadStream(options.path))

@@ -46,3 +48,4 @@ .end(result => processResult(result, options, resolve, reject));

"image_file_b64": options.base64img,
"size": options.size || "regular"
"size": options.size || "regular",
"type": options.type || "auto"
})

@@ -68,2 +71,3 @@ .end(result => processResult(result, options, resolve, reject));

creditsCharged: result.headers["x-credits-charged"],
detectedType: result.headers["x-type"],
resultWidth: result.headers["x-width"],

@@ -70,0 +74,0 @@ resultHeight: result.headers["x-height"]

@@ -11,2 +11,7 @@ interface RemoveBgOptions {

size?: "regular" | "medium" | "hd" | "4k";
/**
* Help the API a little by telling the type of image you want to extract the background from.
* Defaults to "auto".
*/
type?: "auto" | "person" | "product";
outputFile?: string;

@@ -26,2 +31,3 @@ }

creditsCharged: number;
detectedType: "product" | "person";
resultWidth: number;

@@ -28,0 +34,0 @@ resultHeight: number;

@@ -21,3 +21,4 @@ "use strict";

"image_url": options.url,
"size": options.size || "regular"
"size": options.size || "regular",
"type": options.type || "auto"
})

@@ -33,2 +34,3 @@ .end(result => processResult(result, options, resolve, reject));

.field("size", options.size || "regular")
.field("type", options.type || "auto")
.attach("image_file", fs.createReadStream(options.path))

@@ -46,3 +48,4 @@ .end(result => processResult(result, options, resolve, reject));

"image_file_b64": options.base64img,
"size": options.size || "regular"
"size": options.size || "regular",
"type": options.type || "auto"
})

@@ -68,2 +71,3 @@ .end(result => processResult(result, options, resolve, reject));

creditsCharged: result.headers["x-credits-charged"],
detectedType: result.headers["x-type"],
resultWidth: result.headers["x-width"],

@@ -70,0 +74,0 @@ resultHeight: result.headers["x-height"]

{
"name": "remove.bg",
"version": "1.0.3",
"version": "1.1.0",
"description": "A simple wrapper for the remove.bg API",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -39,2 +39,3 @@ # [remove.bg](https://www.remove.bg) API wrapper for Node.js

| size | N | `"regular"` / `"medium"` / `"hd"` / `"4k"` | The returned size of the image. The cheaper `"regular"` option is default. |
| type | N | `"auto"` / `"person"` / `"product"` | Help the API a little by telling the type of image you want to extract the background from. Default `"auto"`. |
| outputFile | N | `string` | The path to save the returned file to. |

@@ -48,2 +49,3 @@

| creditsCharged | `number` | Amount of credits charged for this call, based on the output size of the response.
| detectedType | `string` | Either a `person` or a `product`.
| resultWidth | `number` | The width of the result image, in pixels.

@@ -65,2 +67,3 @@ | resultHeight | `number` | The height of the result image, in pixels.

size: "regular",
type: "auto",
outputFile

@@ -88,2 +91,3 @@ }).then((result: RemoveBgResult) => {

size: "regular",
type: "person",
outputFile

@@ -113,2 +117,3 @@ }).then((result: RemoveBgResult) => {

size: "regular",
type: "product",
outputFile

@@ -115,0 +120,0 @@ }).then((result: RemoveBgResult) => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc