@imgly/background-removal-node
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -7,2 +7,8 @@ # Changelog | ||
## [1.4.0] | ||
### Added | ||
- Added option to apply segmentation mask to any image. Used for applying the same mask to srcsets. | ||
## [1.3.0] | ||
@@ -9,0 +15,0 @@ |
declare module '@imgly/background-removal-node/src/codecs' { | ||
export { imageEncode, imageDecode }; | ||
export { imageEncode, imageDecode, MimeType }; | ||
import { NdArray } from 'ndarray'; | ||
function imageDecode(blob: Blob): Promise<NdArray<Uint8Array>>; | ||
function imageEncode(imageTensor: NdArray<Uint8Array>, quality?: number, type?: string): Promise<Blob>; | ||
class MimeType { | ||
type: string; | ||
params: Record<string, string>; | ||
private constructor(); | ||
toString(): string; | ||
static create(type: any, params: Record<string, string>): MimeType; | ||
isIdentical(other: MimeType): Boolean; | ||
isEqual(other: MimeType): Boolean; | ||
static fromString(mimeType: string): MimeType; | ||
} | ||
@@ -10,3 +20,3 @@ } | ||
export default removeBackground; | ||
export { removeBackground, removeForeground, segmentForeground }; | ||
export { removeBackground, removeForeground, segmentForeground, applySegmentationMask }; | ||
export type { Config, ImageSource }; | ||
@@ -39,2 +49,3 @@ import { Config } from '@imgly/background-removal-node/src/schema'; | ||
function segmentForeground(image: ImageSource, configuration?: Config): Promise<Blob>; | ||
function applySegmentationMask(image: any, mask: any, config?: Config): Promise<Blob>; | ||
@@ -55,3 +66,3 @@ } | ||
output?: { | ||
format?: "image/png" | "image/x-alpha8" | "image/x-rgba8" | "image/jpeg" | "image/webp"; | ||
format?: "image/x-alpha8" | "image/x-rgba8" | "image/png" | "image/jpeg" | "image/webp"; | ||
quality?: number; | ||
@@ -100,6 +111,6 @@ }; | ||
}, "strip", z.ZodTypeAny, { | ||
format?: "image/png" | "image/x-alpha8" | "image/x-rgba8" | "image/jpeg" | "image/webp"; | ||
format?: "image/x-alpha8" | "image/x-rgba8" | "image/png" | "image/jpeg" | "image/webp"; | ||
quality?: number; | ||
}, { | ||
format?: "image/png" | "image/x-alpha8" | "image/x-rgba8" | "image/jpeg" | "image/webp"; | ||
format?: "image/x-alpha8" | "image/x-rgba8" | "image/png" | "image/jpeg" | "image/webp"; | ||
quality?: number; | ||
@@ -115,3 +126,3 @@ }>>; | ||
output?: { | ||
format?: "image/png" | "image/x-alpha8" | "image/x-rgba8" | "image/jpeg" | "image/webp"; | ||
format?: "image/x-alpha8" | "image/x-rgba8" | "image/png" | "image/jpeg" | "image/webp"; | ||
quality?: number; | ||
@@ -127,3 +138,3 @@ }; | ||
output?: { | ||
format?: "image/png" | "image/x-alpha8" | "image/x-rgba8" | "image/jpeg" | "image/webp"; | ||
format?: "image/x-alpha8" | "image/x-rgba8" | "image/png" | "image/jpeg" | "image/webp"; | ||
quality?: number; | ||
@@ -142,3 +153,3 @@ }; | ||
declare module '@imgly/background-removal-node/src/utils' { | ||
export { imageDecode, imageEncode, tensorResizeBilinear, tensorHWCtoBCHW, imageBitmapToImageData, calculateProportionalSize, imageSourceToImageData, ImageSource, convertFloat32ToUint8 }; | ||
export { imageDecode, imageEncode, tensorResizeBilinear, tensorHWCtoBCHW, calculateProportionalSize, imageSourceToImageData, ImageSource, convertFloat32ToUint8 }; | ||
import { Config } from '@imgly/background-removal-node/src/schema'; | ||
@@ -148,3 +159,2 @@ import { NdArray } from 'ndarray'; | ||
type ImageSource = ArrayBuffer | Uint8Array | Blob | URL | string; | ||
function imageBitmapToImageData(imageBitmap: ImageBitmap): ImageData; | ||
function tensorResizeBilinear(imageTensor: NdArray<Uint8Array>, newWidth: number, newHeight: number): NdArray<Uint8Array>; | ||
@@ -151,0 +161,0 @@ function tensorHWCtoBCHW(imageTensor: NdArray<Uint32Array>, mean?: number[], std?: number[]): NdArray<Float32Array>; |
@@ -6,54 +6,76 @@ { | ||
"hash": "b34a3e9350ad77140964b6a2e1e32cd9738acd9d01e5899b96be71901a22ef47", | ||
"offset": 0, | ||
"size": 4194304 | ||
"offsets": [ | ||
0, | ||
4194304 | ||
] | ||
}, | ||
{ | ||
"hash": "8a85c22e472bed10198298a3d57480a5a90946dba88bddecf8b0bf0eafc06e70", | ||
"offset": 4194304, | ||
"size": 4194304 | ||
"offsets": [ | ||
4194304, | ||
8388608 | ||
] | ||
}, | ||
{ | ||
"hash": "5faec25d2338ae8ca2c7bff72e954cebd40a04c5f34c4b6bb8ca6720fae40996", | ||
"offset": 8388608, | ||
"size": 4194304 | ||
"offsets": [ | ||
8388608, | ||
12582912 | ||
] | ||
}, | ||
{ | ||
"hash": "b9861d932a549be455fc8ebd8ce5d413049515bfdd3edd55e136dbe05dd34ef5", | ||
"offset": 12582912, | ||
"size": 4194304 | ||
"offsets": [ | ||
12582912, | ||
16777216 | ||
] | ||
}, | ||
{ | ||
"hash": "f070b4c4f512cfe8dd6936c3cb9a616f132894867d3d33304d83599eb6b55636", | ||
"offset": 16777216, | ||
"size": 4194304 | ||
"offsets": [ | ||
16777216, | ||
20971520 | ||
] | ||
}, | ||
{ | ||
"hash": "10d02652d10fbc47bf93732ff9e8ad53eefbd3bd89ab3c1fbc15ddd740bea672", | ||
"offset": 20971520, | ||
"size": 4194304 | ||
"offsets": [ | ||
20971520, | ||
25165824 | ||
] | ||
}, | ||
{ | ||
"hash": "014c9e0229363137e92b85ed3c6f56b1386c279cdd9af2d7f1960ed8428b5e94", | ||
"offset": 25165824, | ||
"size": 4194304 | ||
"offsets": [ | ||
25165824, | ||
29360128 | ||
] | ||
}, | ||
{ | ||
"hash": "34dd3ad760f7e31b5e9144b8c387b8ecd6dc43116248c93c56dd7051ab525e3b", | ||
"offset": 29360128, | ||
"size": 4194304 | ||
"offsets": [ | ||
29360128, | ||
33554432 | ||
] | ||
}, | ||
{ | ||
"hash": "e7ca5cc3e0afd65581642a05ac91eb8ea4d0deb868df94b8981c910212526476", | ||
"offset": 33554432, | ||
"size": 4194304 | ||
"offsets": [ | ||
33554432, | ||
37748736 | ||
] | ||
}, | ||
{ | ||
"hash": "0ad4ebb86cfdd847901427181b7a7804dba93d868c3cd5f11a294acf36c9413f", | ||
"offset": 37748736, | ||
"size": 4194304 | ||
"offsets": [ | ||
37748736, | ||
41943040 | ||
] | ||
}, | ||
{ | ||
"hash": "9582c0375aed822c5577a814766c4afc6c096f4ccd3b0d08af6a1794987206a1", | ||
"offset": 41943040, | ||
"size": 2399396 | ||
"offsets": [ | ||
41943040, | ||
44342436 | ||
] | ||
} | ||
@@ -68,109 +90,153 @@ ], | ||
"hash": "fe1b9f06af9d2147016884f4eb683d4dc540244a7453c3b742ae527725df2eec", | ||
"offset": 0, | ||
"size": 4194304 | ||
"offsets": [ | ||
0, | ||
4194304 | ||
] | ||
}, | ||
{ | ||
"hash": "724543b36c7b5eddfbd7f55cb5a7c1676b2089c277611850c257efa42212d8a2", | ||
"offset": 4194304, | ||
"size": 4194304 | ||
"offsets": [ | ||
4194304, | ||
8388608 | ||
] | ||
}, | ||
{ | ||
"hash": "f9290547b2e34555536647c1e2ca456348170eef1aee05d8fd522f5a051f260c", | ||
"offset": 8388608, | ||
"size": 4194304 | ||
"offsets": [ | ||
8388608, | ||
12582912 | ||
] | ||
}, | ||
{ | ||
"hash": "897d4d8a3f9f8c07f439300a5d81c8be4b0fcecf19ca6d77929b1750fedd8306", | ||
"offset": 12582912, | ||
"size": 4194304 | ||
"offsets": [ | ||
12582912, | ||
16777216 | ||
] | ||
}, | ||
{ | ||
"hash": "cbcda0a0c830ba51928e7935d9d3cfe1c4dc258bf117f2c76d047113ab8f9f8c", | ||
"offset": 16777216, | ||
"size": 4194304 | ||
"offsets": [ | ||
16777216, | ||
20971520 | ||
] | ||
}, | ||
{ | ||
"hash": "4c44c8b64af9f044623ceace7cc55e0bc348394f7ff63629d46118c0a03c9c54", | ||
"offset": 20971520, | ||
"size": 4194304 | ||
"offsets": [ | ||
20971520, | ||
25165824 | ||
] | ||
}, | ||
{ | ||
"hash": "8b2e3d773d7084c5cfac1c04d69d3586e4b8914a840d2b582dfde4940d698957", | ||
"offset": 25165824, | ||
"size": 4194304 | ||
"offsets": [ | ||
25165824, | ||
29360128 | ||
] | ||
}, | ||
{ | ||
"hash": "024e3d8beaf517d25496b73e36b0e0498110652753273e0dd8b591ad7c1c9e2f", | ||
"offset": 29360128, | ||
"size": 4194304 | ||
"offsets": [ | ||
29360128, | ||
33554432 | ||
] | ||
}, | ||
{ | ||
"hash": "1b8eaad4cd019b76e7eba964a38711a0bdeafbd10b6208c1107403a64dbd902a", | ||
"offset": 33554432, | ||
"size": 4194304 | ||
"offsets": [ | ||
33554432, | ||
37748736 | ||
] | ||
}, | ||
{ | ||
"hash": "0c8c5c24237304482ccc70a50008b73c8ef53e4656068da32b635607cca0c8c9", | ||
"offset": 37748736, | ||
"size": 4194304 | ||
"offsets": [ | ||
37748736, | ||
41943040 | ||
] | ||
}, | ||
{ | ||
"hash": "a5b8c519c832bc46b2ae5a9887fac1e3d5cc76a04846d8c3544875c7f2b40960", | ||
"offset": 41943040, | ||
"size": 4194304 | ||
"offsets": [ | ||
41943040, | ||
46137344 | ||
] | ||
}, | ||
{ | ||
"hash": "7b1dd767c5c1c0156b8d13bb34d4c1d11e014723b10cddc25c93e89a28e7cd96", | ||
"offset": 46137344, | ||
"size": 4194304 | ||
"offsets": [ | ||
46137344, | ||
50331648 | ||
] | ||
}, | ||
{ | ||
"hash": "3f5638267419916c9d4d906ff25f721d3d2e034851ea01566f0d2d6f943550b8", | ||
"offset": 50331648, | ||
"size": 4194304 | ||
"offsets": [ | ||
50331648, | ||
54525952 | ||
] | ||
}, | ||
{ | ||
"hash": "9927e74b3a0638d4cf5701e78e66d77476a4ba68c75831f1c8ea9117ec7f8809", | ||
"offset": 54525952, | ||
"size": 4194304 | ||
"offsets": [ | ||
54525952, | ||
58720256 | ||
] | ||
}, | ||
{ | ||
"hash": "3315eb3c14ca3ff5c03c80fac58f486a14264dd0bb9c168c096f2bd2531ba438", | ||
"offset": 58720256, | ||
"size": 4194304 | ||
"offsets": [ | ||
58720256, | ||
62914560 | ||
] | ||
}, | ||
{ | ||
"hash": "230f667e0332dc09ef08aacbf1992c40ce112192f95dfc14231a3ef515f9a2c7", | ||
"offset": 62914560, | ||
"size": 4194304 | ||
"offsets": [ | ||
62914560, | ||
67108864 | ||
] | ||
}, | ||
{ | ||
"hash": "e01a157b677e0e17815cd738dcda7e6daa268898d006b52b5d3604c439e6c96e", | ||
"offset": 67108864, | ||
"size": 4194304 | ||
"offsets": [ | ||
67108864, | ||
71303168 | ||
] | ||
}, | ||
{ | ||
"hash": "529f1df7d027b0315090ba15d42ef32998cac2efd6783c62f6b11cedf4c548f3", | ||
"offset": 71303168, | ||
"size": 4194304 | ||
"offsets": [ | ||
71303168, | ||
75497472 | ||
] | ||
}, | ||
{ | ||
"hash": "6cfd013f552a05e9fc81156e6d6de593668e0247a3970feae22e285c16d13e62", | ||
"offset": 75497472, | ||
"size": 4194304 | ||
"offsets": [ | ||
75497472, | ||
79691776 | ||
] | ||
}, | ||
{ | ||
"hash": "3f31511c3c16a29cf81b32379f51ead2bd082677b48b1dcc11a66beeb37cc729", | ||
"offset": 79691776, | ||
"size": 4194304 | ||
"offsets": [ | ||
79691776, | ||
83886080 | ||
] | ||
}, | ||
{ | ||
"hash": "01f6efcc8a01c727d99073ceede8e64c654fa3c4612b006e69e22dc663236943", | ||
"offset": 83886080, | ||
"size": 4194304 | ||
"offsets": [ | ||
83886080, | ||
88080384 | ||
] | ||
}, | ||
{ | ||
"hash": "145d8355f50b7847de5d04815124790867fe1752a0013bdf6ce28882b5e0a2fc", | ||
"offset": 88080384, | ||
"size": 108095 | ||
"offsets": [ | ||
88080384, | ||
88188479 | ||
] | ||
} | ||
@@ -177,0 +243,0 @@ ], |
{ | ||
"name": "@imgly/background-removal-node", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Background Removal in NodeJS", | ||
"resources": "@imgly/background-removal-node", | ||
"keywords": [ | ||
@@ -49,4 +50,4 @@ "background-removal", | ||
"resources": "node ../../scripts/package-resources.mjs", | ||
"changelog:create": "node ../../scripts/changelog/create.mjs", | ||
"changelog:generate": "node ../../scripts/changelog/generate.mjs", | ||
"changelog:create": "node ../../scripts/changelog/changelog-create.mjs", | ||
"changelog:generate": "node ../../scripts/changelog/changelog-generate.mjs", | ||
"build": "npm run clean && npm run resources && npm run changelog:generate && node scripts/build.mjs", | ||
@@ -53,0 +54,0 @@ "watch": "npm run clean && npm run resources && npm run changelog:generate && node scripts/watch.mjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
132666825
1503