@imagemagick/magick-wasm 0.0.39 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +5 -5
- package/README.md +3 -5
- package/dist/index.d.ts +7 -0
- package/dist/index.js +28 -16
- package/dist/index.umd.cjs +2 -2
- package/dist/magick.wasm +0 -0
- package/package.json +11 -10
package/NOTICE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[ ImageMagick 7.1.2-
|
|
1
|
+
[ ImageMagick 7.1.2-19 (2026-04-12) ]
|
|
2
2
|
|
|
3
3
|
ImageMagick License
|
|
4
4
|
https://imagemagick.org/license/
|
|
@@ -107,7 +107,7 @@ To apply the ImageMagick License to your work, attach the following boilerplate
|
|
|
107
107
|
License for the specific language governing permissions and limitations
|
|
108
108
|
under the License.
|
|
109
109
|
|
|
110
|
-
[ aom 3.13.
|
|
110
|
+
[ aom 3.13.3 (2026-04-02) ]
|
|
111
111
|
|
|
112
112
|
Copyright (c) 2016, Alliance for Open Media. All rights reserved.
|
|
113
113
|
|
|
@@ -1032,7 +1032,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
1032
1032
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1033
1033
|
SOFTWARE.
|
|
1034
1034
|
|
|
1035
|
-
[ exr 3.4.
|
|
1035
|
+
[ exr 3.4.9 (2026-04-03) ]
|
|
1036
1036
|
|
|
1037
1037
|
Copyright (c) Contributors to the OpenEXR Project. All rights reserved.
|
|
1038
1038
|
|
|
@@ -1070,7 +1070,7 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
1070
1070
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
1071
1071
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1072
1072
|
|
|
1073
|
-
[ freetype 2.14.
|
|
1073
|
+
[ freetype 2.14.3 (2026-03-22) ]
|
|
1074
1074
|
|
|
1075
1075
|
The FreeType Project LICENSE
|
|
1076
1076
|
----------------------------
|
|
@@ -3271,7 +3271,7 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
3271
3271
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
3272
3272
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
3273
3273
|
|
|
3274
|
-
[ png 1.6.
|
|
3274
|
+
[ png 1.6.56 (2026-03-25) ]
|
|
3275
3275
|
|
|
3276
3276
|
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
|
|
3277
3277
|
=========================================
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://github.com/sponsors/dlemstra)
|
|
7
7
|
|
|
8
8
|
ImageMagick is a powerful image manipulation library that supports over [100 major file formats](https://www.imagemagick.org/script/formats.php) (not including sub-formats).
|
|
9
|
-
With magick-wasm you can use ImageMagick in your web application without doing a callback to an api.
|
|
9
|
+
With magick-wasm you can use ImageMagick in your web application without doing a callback to an api. And this library also allows you to use ImageMagick in Node.js or Deno without installing ImageMagick on the system.
|
|
10
10
|
|
|
11
11
|
## Documentation
|
|
12
12
|
|
|
@@ -21,10 +21,8 @@ Follow me on bluesky ([@dirk.lemstra.org](https://bsky.app/profile/dirk.lemstra.
|
|
|
21
21
|
|
|
22
22
|
## Release notes
|
|
23
23
|
|
|
24
|
-
The release notes can be found on [GitHub](https://github.com/dlemstra/magick-wasm/releases/tag/0.0.
|
|
24
|
+
The release notes can be found on [GitHub](https://github.com/dlemstra/magick-wasm/releases/tag/0.0.40).
|
|
25
25
|
|
|
26
26
|
## Donate
|
|
27
27
|
|
|
28
|
-
If you have an uncontrollable urge to give me something for the time and effort I am putting into this project then please
|
|
29
|
-
[amazon wish list](http://www.amazon.de/registry/wishlist/2XFZAC3J04WAY) or send me an [amazon gift card](https://www.amazon.de/Amazon-Gutschein-per-E-Mail-Amazon/dp/B0054PDOV8).
|
|
30
|
-
If you prefer to use PayPal then [click here](https://www.paypal.me/DirkLemstra). You can also sponsor me through [GitHub Sponsors](https://github.com/sponsors/dlemstra).
|
|
28
|
+
If you have an uncontrollable urge to give me something for the time and effort I am putting into this project then please sponsor me through [GitHub Sponsors](https://github.com/sponsors/dlemstra) or send me an [amazon gift card](https://www.amazon.de/Amazon-Gutschein-per-E-Mail-Amazon/dp/B0054PDOV8). If you prefer to use PayPal then [click here](https://www.paypal.me/DirkLemstra).
|
package/dist/index.d.ts
CHANGED
|
@@ -2139,6 +2139,10 @@ export interface IMagickImage extends IDisposable {
|
|
|
2139
2139
|
setProfile(profile: IImageProfile): void;
|
|
2140
2140
|
setProfile(name: string, data: ByteArray): void;
|
|
2141
2141
|
setWriteMask(image: IMagickImage): void;
|
|
2142
|
+
shadow(): void;
|
|
2143
|
+
shadow(color: IMagickColor): void;
|
|
2144
|
+
shadow(x: number, y: number, sigma: number, alpha: Percentage): void;
|
|
2145
|
+
shadow(x: number, y: number, sigma: number, alpha: Percentage, color: IMagickColor): void;
|
|
2142
2146
|
sharpen(): void;
|
|
2143
2147
|
sharpen(radius: number, sigma: number): void;
|
|
2144
2148
|
sharpen(radius: number, sigma: number, channels: Channels): void;
|
|
@@ -2484,6 +2488,9 @@ export declare class MagickImage extends NativeInstance implements IMagickImage
|
|
|
2484
2488
|
setProfile(profile: IImageProfile): void;
|
|
2485
2489
|
setProfile(pname: string, data: ByteArray): void;
|
|
2486
2490
|
setWriteMask(image: IMagickImage): void;
|
|
2491
|
+
shadow(): void;
|
|
2492
|
+
shadow(color: IMagickColor): void;
|
|
2493
|
+
shadow(x: number, y: number, sigma: number, alpha: Percentage): void;
|
|
2487
2494
|
sharpen(): void;
|
|
2488
2495
|
sharpen(radius: number, sigma: number): void;
|
|
2489
2496
|
sharpen(radius: number, sigma: number, channels: Channels): void;
|
package/dist/index.js
CHANGED
|
@@ -1255,7 +1255,7 @@ var Ce = class e extends ve {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
fontTypeMetrics(e, t) {
|
|
1257
1257
|
return A.usePointer((n) => E(e, (e) => {
|
|
1258
|
-
let r = V._api._DrawingWand_FontTypeMetrics(this._instance, e, t
|
|
1258
|
+
let r = V._api._DrawingWand_FontTypeMetrics(this._instance, e, +!!t, n);
|
|
1259
1259
|
return ye._create(r);
|
|
1260
1260
|
}));
|
|
1261
1261
|
}
|
|
@@ -1352,7 +1352,7 @@ var Ce = class e extends ve {
|
|
|
1352
1352
|
}
|
|
1353
1353
|
textAntialias(e) {
|
|
1354
1354
|
A.usePointer((t) => {
|
|
1355
|
-
V._api._DrawingWand_TextAntialias(this._instance, e
|
|
1355
|
+
V._api._DrawingWand_TextAntialias(this._instance, +!!e, t);
|
|
1356
1356
|
});
|
|
1357
1357
|
}
|
|
1358
1358
|
textDecoration(e) {
|
|
@@ -1774,7 +1774,7 @@ var N = class e {
|
|
|
1774
1774
|
let i = e.strokeDashArray;
|
|
1775
1775
|
i !== void 0 && xe(i, (e) => {
|
|
1776
1776
|
V._api._DrawingSettings_SetStrokeDashArray(this._instance, e, i.length);
|
|
1777
|
-
}), e.strokeDashOffset !== void 0 && V._api._DrawingSettings_StrokeDashOffset_Set(this._instance, e.strokeDashOffset), e.strokeWidth !== void 0 && V._api._DrawingSettings_StrokeWidth_Set(this._instance, e.strokeWidth), e.textAntiAlias !== void 0 && V._api._DrawingSettings_TextAntiAlias_Set(this._instance, e.textAntiAlias
|
|
1777
|
+
}), e.strokeDashOffset !== void 0 && V._api._DrawingSettings_StrokeDashOffset_Set(this._instance, e.strokeDashOffset), e.strokeWidth !== void 0 && V._api._DrawingSettings_StrokeWidth_Set(this._instance, e.strokeWidth), e.textAntiAlias !== void 0 && V._api._DrawingSettings_TextAntiAlias_Set(this._instance, +!!e.textAntiAlias), e.textGravity !== void 0 && V._api._DrawingSettings_TextGravity_Set(this._instance, e.textGravity), e.textKerning !== void 0 && V._api._DrawingSettings_TextKerning_Set(this._instance, e.textKerning), e.textUnderColor !== void 0 && e.textUnderColor._use((e) => {
|
|
1778
1778
|
V._api._DrawingSettings_TextUnderColor_Set(this._instance, e);
|
|
1779
1779
|
});
|
|
1780
1780
|
}
|
|
@@ -1817,9 +1817,9 @@ var N = class e {
|
|
|
1817
1817
|
let t = V._api._MagickSettings_Create(), n = V._api._MagickSettings_Dispose;
|
|
1818
1818
|
super(t, n), e._colorFuzz !== void 0 && V._api._MagickSettings_SetColorFuzz(this._instance, e._colorFuzz), e._fileName !== void 0 && E(e._fileName, (e) => {
|
|
1819
1819
|
V._api._MagickSettings_SetFileName(this._instance, e);
|
|
1820
|
-
}), e._ping && V._api._MagickSettings_SetPing(this._instance, 1), e._quality !== void 0 && V._api._MagickSettings_SetQuality(this._instance, e._quality), e.antiAlias !== void 0 && V._api._MagickSettings_AntiAlias_Set(this._instance, e.antiAlias
|
|
1820
|
+
}), e._ping && V._api._MagickSettings_SetPing(this._instance, 1), e._quality !== void 0 && V._api._MagickSettings_SetQuality(this._instance, e._quality), e.antiAlias !== void 0 && V._api._MagickSettings_AntiAlias_Set(this._instance, +!!e.antiAlias), e.backgroundColor !== void 0 && e.backgroundColor._use((e) => {
|
|
1821
1821
|
V._api._MagickSettings_BackgroundColor_Set(this._instance, e);
|
|
1822
|
-
}), e.colorSpace !== void 0 && V._api._MagickSettings_ColorSpace_Set(this._instance, e.colorSpace), e.colorType !== void 0 && V._api._MagickSettings_ColorType_Set(this._instance, e.colorType), e.compression !== void 0 && V._api._MagickSettings_Compression_Set(this._instance, e.compression), e.debug !== void 0 && V._api._MagickSettings_Debug_Set(this._instance, e.debug
|
|
1822
|
+
}), e.colorSpace !== void 0 && V._api._MagickSettings_ColorSpace_Set(this._instance, e.colorSpace), e.colorType !== void 0 && V._api._MagickSettings_ColorType_Set(this._instance, e.colorType), e.compression !== void 0 && V._api._MagickSettings_Compression_Set(this._instance, e.compression), e.debug !== void 0 && V._api._MagickSettings_Debug_Set(this._instance, +!!e.debug), e.density !== void 0 && E(e.density.toString(), (e) => {
|
|
1823
1823
|
V._api._MagickSettings_Density_Set(this._instance, e);
|
|
1824
1824
|
}), e.depth !== void 0 && V._api._MagickSettings_Depth_Set(this._instance, e.depth), e.endian !== void 0 && V._api._MagickSettings_Endian_Set(this._instance, e.endian), e.fillColor !== void 0 && this.setOption("fill", e.fillColor.toString()), e.font !== void 0 && E($e._getFontFileName(e.font), (e) => {
|
|
1825
1825
|
V._api._MagickSettings_SetFont(this._instance, e);
|
|
@@ -2026,7 +2026,7 @@ var N = class e {
|
|
|
2026
2026
|
}, Me = class extends ve {
|
|
2027
2027
|
constructor(e) {
|
|
2028
2028
|
let t = V._api._QuantizeSettings_Create(), n = V._api._QuantizeSettings_Dispose;
|
|
2029
|
-
super(t, n), V._api._QuantizeSettings_SetColors(this._instance, e.colors), V._api._QuantizeSettings_SetColorSpace(this._instance, e.colorSpace), V._api._QuantizeSettings_SetDitherMethod(this._instance, e.ditherMethod ?? je.No), V._api._QuantizeSettings_SetMeasureErrors(this._instance, e.measureErrors
|
|
2029
|
+
super(t, n), V._api._QuantizeSettings_SetColors(this._instance, e.colors), V._api._QuantizeSettings_SetColorSpace(this._instance, e.colorSpace), V._api._QuantizeSettings_SetDitherMethod(this._instance, e.ditherMethod ?? je.No), V._api._QuantizeSettings_SetMeasureErrors(this._instance, +!!e.measureErrors), V._api._QuantizeSettings_SetTreeDepth(this._instance, e.treeDepth);
|
|
2030
2030
|
}
|
|
2031
2031
|
}, Ne = class {
|
|
2032
2032
|
constructor() {
|
|
@@ -2277,7 +2277,7 @@ var N = class e {
|
|
|
2277
2277
|
this.dispose(), this.addImages(t, n);
|
|
2278
2278
|
}
|
|
2279
2279
|
smush(e, t, n) {
|
|
2280
|
-
return this.createImage((n, r) => V._api._MagickImageCollection_Smush(n, e, t
|
|
2280
|
+
return this.createImage((n, r) => V._api._MagickImageCollection_Smush(n, e, +!!t, r.ptr), n);
|
|
2281
2281
|
}
|
|
2282
2282
|
throwIfEmpty() {
|
|
2283
2283
|
if (this.length === 0) throw new C("operation requires at least one image");
|
|
@@ -2664,7 +2664,7 @@ var N = class e {
|
|
|
2664
2664
|
return V._api._MagickImage_BlackPointCompensation_Get(this._instance) === 1;
|
|
2665
2665
|
}
|
|
2666
2666
|
set blackPointCompensation(e) {
|
|
2667
|
-
V._api._MagickImage_BlackPointCompensation_Set(this._instance, e
|
|
2667
|
+
V._api._MagickImage_BlackPointCompensation_Set(this._instance, +!!e);
|
|
2668
2668
|
}
|
|
2669
2669
|
get borderColor() {
|
|
2670
2670
|
let e = V._api._MagickImage_BorderColor_Get(this._instance);
|
|
@@ -3182,7 +3182,7 @@ var N = class e {
|
|
|
3182
3182
|
distort(e, t) {
|
|
3183
3183
|
Pe.use(this, (n) => {
|
|
3184
3184
|
let r, i = 0;
|
|
3185
|
-
typeof e == "number" ? r = e : (r = e.method, i = e.bestFit
|
|
3185
|
+
typeof e == "number" ? r = e : (r = e.method, i = +!!e.bestFit, e._setArtifacts(n)), this.useException((e) => {
|
|
3186
3186
|
xe(t, (n) => {
|
|
3187
3187
|
let a = V._api._MagickImage_Distort(this._instance, r, i, n, t.length, e.ptr);
|
|
3188
3188
|
this._setInstance(a, e);
|
|
@@ -3522,6 +3522,18 @@ var N = class e {
|
|
|
3522
3522
|
V._api._MagickImage_SetWriteMask(this._instance, e._instance, t);
|
|
3523
3523
|
});
|
|
3524
3524
|
}
|
|
3525
|
+
shadow(e, t, n, r, i) {
|
|
3526
|
+
let a, o = typeof e == "number" ? e : 5, s = this.valueOrDefault(t, 5), c = this.valueOrDefault(n, .5), l = this.valueOrDefault(r, new L(80)), u = typeof e == "number" ? i : e;
|
|
3527
|
+
u !== void 0 && (a = this.backgroundColor, this.backgroundColor = u);
|
|
3528
|
+
try {
|
|
3529
|
+
this.useException((e) => {
|
|
3530
|
+
let t = V._api._MagickImage_Shadow(this._instance, o, s, c, l.toDouble(), e.ptr);
|
|
3531
|
+
this._setInstance(t, e);
|
|
3532
|
+
});
|
|
3533
|
+
} finally {
|
|
3534
|
+
a !== void 0 && (this.backgroundColor = a);
|
|
3535
|
+
}
|
|
3536
|
+
}
|
|
3525
3537
|
sharpen(e, t, n) {
|
|
3526
3538
|
let r = this.valueOrDefault(e, 0), i = this.valueOrDefault(t, 1), a = this.valueOrDefault(n, h.Undefined);
|
|
3527
3539
|
this.useException((e) => {
|
|
@@ -3608,8 +3620,8 @@ var N = class e {
|
|
|
3608
3620
|
let t = e[0];
|
|
3609
3621
|
this.setArtifact("trim:percent-background", t.toDouble().toString());
|
|
3610
3622
|
} else {
|
|
3611
|
-
let t =
|
|
3612
|
-
this.setArtifact("trim:edges",
|
|
3623
|
+
let t = [...new Set(Te(e))].join(",");
|
|
3624
|
+
this.setArtifact("trim:edges", t);
|
|
3613
3625
|
}
|
|
3614
3626
|
this.useException((e) => {
|
|
3615
3627
|
let t = V._api._MagickImage_Trim(this._instance, e.ptr);
|
|
@@ -3716,7 +3728,7 @@ var N = class e {
|
|
|
3716
3728
|
});
|
|
3717
3729
|
}
|
|
3718
3730
|
fromBool(e) {
|
|
3719
|
-
return e
|
|
3731
|
+
return +!!e;
|
|
3720
3732
|
}
|
|
3721
3733
|
getProfilePrivate(e) {
|
|
3722
3734
|
return E(e, (e) => {
|
|
@@ -4003,13 +4015,13 @@ var N = class e {
|
|
|
4003
4015
|
return x[this.ptr + 8 >>> 2 >>> 0];
|
|
4004
4016
|
}
|
|
4005
4017
|
set_caught(e) {
|
|
4006
|
-
e = e
|
|
4018
|
+
e = +!!e, _[this.ptr + 12 >>> 0] = e;
|
|
4007
4019
|
}
|
|
4008
4020
|
get_caught() {
|
|
4009
4021
|
return _[this.ptr + 12 >>> 0] != 0;
|
|
4010
4022
|
}
|
|
4011
4023
|
set_rethrown(e) {
|
|
4012
|
-
e = e
|
|
4024
|
+
e = +!!e, _[this.ptr + 13 >>> 0] = e;
|
|
4013
4025
|
}
|
|
4014
4026
|
get_rethrown() {
|
|
4015
4027
|
return _[this.ptr + 13 >>> 0] != 0;
|
|
@@ -7358,7 +7370,7 @@ var Ze = class {
|
|
|
7358
7370
|
let a = e._images[i];
|
|
7359
7371
|
if (a === void 0 || a.onProgress === void 0) return 1;
|
|
7360
7372
|
let o = Number(n), s = Number(r), c = new Ze(T(t), o, s);
|
|
7361
|
-
return a.onProgress(c), c.cancel
|
|
7373
|
+
return a.onProgress(c), +!c.cancel;
|
|
7362
7374
|
}
|
|
7363
7375
|
}, Qe = class e {
|
|
7364
7376
|
static _allFormats;
|
|
@@ -8759,7 +8771,7 @@ var Ze = class {
|
|
|
8759
8771
|
V._api._MontageSettings_SetFrameGeometry(this._instance, e);
|
|
8760
8772
|
}), e.geometry !== void 0 && E(e.geometry.toString(), (e) => {
|
|
8761
8773
|
V._api._MontageSettings_SetGeometry(this._instance, e);
|
|
8762
|
-
}), e.gravity !== void 0 && V._api._MontageSettings_SetGravity(this._instance, e.gravity), e.shadow !== void 0 && V._api._MontageSettings_SetShadow(this._instance, e.shadow
|
|
8774
|
+
}), e.gravity !== void 0 && V._api._MontageSettings_SetGravity(this._instance, e.gravity), e.shadow !== void 0 && V._api._MontageSettings_SetShadow(this._instance, +!!e.shadow), e.strokeColor !== void 0 && e.strokeColor._use((e) => {
|
|
8763
8775
|
V._api._MontageSettings_SetStrokeColor(this._instance, e);
|
|
8764
8776
|
}), e.textureFileName !== void 0 && E(e.textureFileName, (e) => {
|
|
8765
8777
|
V._api._MontageSettings_SetTextureFileName(this._instance, e);
|