Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

jimp

Package Overview
Dependencies
Maintainers
1
Versions
281
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jimp - npm Package Compare versions

Comparing version 0.2.24 to 0.2.25

6

package.json
{
"name": "jimp",
"version": "0.2.24",
"version": "0.2.25",
"description": "An image processing library written entirely in JavaScript (i.e. zero external or native dependencies).",

@@ -31,7 +31,7 @@ "main": "index.js",

"file-type": "^3.1.0",
"jpeg-js": "^0.1.2",
"jpeg-js": "^0.2.0",
"load-bmfont": "^1.2.3",
"mime": "^1.3.4",
"pixelmatch": "^4.0.0",
"pngjs": "2.2.0",
"pngjs": "^3.0.0",
"read-chunk": "^1.0.1",

@@ -38,0 +38,0 @@ "request": "^2.65.0",

@@ -75,4 +75,4 @@ # Jimp #

/* Resize */
image.contain( w, h[, mode] ); // scale the image to the given width and height, some parts of the image may be letter boxed
image.cover( w, h[, mode] ); // scale the image to the given width and height, some parts of the image may be clipped
image.contain( w, h[, alignBits || mode, mode] ); // scale the image to the given width and height, some parts of the image may be letter boxed
image.cover( w, h[, alignBits || mode, mode] ); // scale the image to the given width and height, some parts of the image may be clipped
image.resize( w, h[, mode] ); // resize the image. Jimp.AUTO can be passed as one of the values.

@@ -91,3 +91,3 @@ image.scale( f[, mode] ); // scale the image by the factor f

// blit the image with another Jimp image at x, y, optionally cropped.
image.composite( src, x, y ); // composites another Jimp image over this iamge at x, y
image.composite( src, x, y ); // composites another Jimp image over this image at x, y
image.mask( src, x, y ); // masks the image with another Jimp image at x, y using average pixel value image.rotate) and when writing formats that don't support alpha channels

@@ -159,2 +159,28 @@

### Align modes ###
The following constants can be passed to image.cover and image.contain methods:
```js
Jimp.HORIZONTAL_ALIGN_LEFT;
Jimp.HORIZONTAL_ALIGN_CENTER;
Jimp.HORIZONTAL_ALIGN_RIGHT;
Jimp.VERTICAL_ALIGN_TOP;
Jimp.VERTICAL_ALIGN_MIDDLE;
Jimp.VERTICAL_ALIGN_BOTTOM;
```
For example:
```js
image.contain(250, 250, Jimp.HORIZONTAL_ALIGN_LEFT | Jimp.VERTICAL_ALIGN_TOP);
```
Default align modes are :
```js
Jimp.HORIZONTAL_ALIGN_CENTER | Jimp.VERTICAL_ALIGN_MIDDLE;
```
### Writing text ###

@@ -166,3 +192,4 @@

Jimp.loadFont( path ).then(function (font) { // load font from .fnt file
image.print(font, x, y, str); // print a message on an image
image.print(font, x, y, str); // print a message on an image
image.print(font, x, y, str, width); // print a message on an image with text wrapped at width
});

@@ -236,5 +263,6 @@

```js
image.rgba( bool ); // set whether PNGs are saved as RGBA (true, default) or RGB (false)
image.filterType( number ); // set the filter type for the saved PNG
image.deflateLevel( number ); // set the deflate level for the saved PNG
image.rgba( bool ); // set whether PNGs are saved as RGBA (true, default) or RGB (false)
image.filterType( number ); // set the filter type for the saved PNG
image.deflateLevel( number ); // set the deflate level for the saved PNG
Jimp.deflateStrategy( number ); // set the deflate for the saved PNG (0-3)
```

@@ -241,0 +269,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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