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.7 to 0.2.8

cli/index.js

8

package.json
{
"name": "jimp",
"version": "0.2.7",
"version": "0.2.8",
"description": "An image processing library written entirely in JavaScript (i.e. zero external or native dependencies).",
"main": "jimp.js",
"main": "index.js",
"bin": {
"jimp": "cli/index.js"
},
"scripts": {

@@ -25,2 +28,3 @@ "test": "echo \"Error: no test specified\" && exit 1"

"bmp-js": "0.0.1",
"commander": "^2.8.1",
"file-type": "^2.10.2",

@@ -27,0 +31,0 @@ "jpeg-js": "^0.1.1",

@@ -46,3 +46,3 @@ # Jimp #

image.opacity( f ); // multiply the alpha channel by each pixel by the factor f, 0 - 1
image.resize( w, h ); // resize the image
image.resize( w, h ); // resize the image. Jimp.AUTO can be passed as one of the values.
image.scale( f ); // scale the image by the factor f

@@ -82,4 +82,17 @@ image.rotate( deg[, resize] ); // rotate the image clockwise by a number of degrees. Unless `false` is passed as the second parameter, the image width and height will be resized appropriately.

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
```
For convenience, supported filter types are available as static properties:
```js
Jimp.PNG_FILTER_AUTO; // -1;
Jimp.PNG_FILTER_NONE; // 0;
Jimp.PNG_FILTER_SUB; // 1;
Jimp.PNG_FILTER_UP; // 2;
Jimp.PNG_FILTER_AVERAGE; // 3;
Jimp.PNG_FILTER_PAETH; // 4;
```
## Cloning images ##

@@ -173,3 +186,3 @@

Jimp.intToRGBA(hex); // e.g. converts 0xFFFFFFFF to {r: 255, g: 255, b: 255, a:255}
````
```

@@ -176,0 +189,0 @@ If you want to begin with an empty Jimp image, you can call the Jimp constructor passing the width and height of the image to create:

@@ -1,2 +0,2 @@

var Jimp = require("../jimp.js");
var Jimp = require("../index.js");

@@ -3,0 +3,0 @@ var operations = {

@@ -1,2 +0,2 @@

var Jimp = require("../jimp.js");
var Jimp = require("../index.js");

@@ -86,2 +86,6 @@ // open a file called "lenna.png"

.opaque().write("./output/lenna-opaque.png");
this.clone().resize(Jimp.AUTO, 1024).write("./output/lenna-resize-auto-2014.png");
this.clone().resize(128, Jimp.AUTO).write("./output/lenna-resize-128-auto.png");
});

@@ -1,2 +0,2 @@

var Jimp = require("../jimp.js");
var Jimp = require("../index.js");

@@ -3,0 +3,0 @@ var bars = new Jimp(256, 256, function(err, image) {

@@ -1,2 +0,2 @@

var Jimp = require("../jimp.js");
var Jimp = require("../index.js");

@@ -10,3 +10,3 @@ var lenna = new Jimp("lenna.png", function(err, image) {

var jpg = new Jimp("./output/lenna-copy.jpg", function(err, image) {
jpg.invert().write("./output/lenna-invert.png");
jpg.filterType(Jimp.PNG_FILTER_NONE).deflateLevel(0).invert().write("./output/lenna-invert.png");
});

@@ -13,0 +13,0 @@ }

@@ -1,2 +0,2 @@

var Jimp = require("../jimp.js");
var Jimp = require("../index.js");

@@ -3,0 +3,0 @@ new Jimp("lenna.png", function (err, image) {

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