@jimp/plugin-resize
Advanced tools
Comparing version 0.5.0 to 0.5.1
{ | ||
"name": "@jimp/plugin-resize", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Resize an image.", | ||
@@ -29,4 +29,4 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@jimp/custom": "^0.5.0", | ||
"@jimp/test-utils": "^0.5.0" | ||
"@jimp/custom": "^0.5.1", | ||
"@jimp/test-utils": "^0.5.1" | ||
}, | ||
@@ -36,3 +36,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "fbbe0b7da5a9dcf8da35e2dfb2e8265ca850435c" | ||
"gitHead": "b23ab92550336eed5d4ac422564c7c63ea280c73" | ||
} |
@@ -28,1 +28,30 @@ <div align="center"> | ||
``` | ||
## Auto | ||
`Jimp.AUTO` can be passes to either the height or width and jimp will scale the image accordingly. `Jimp.AUTO` cannot be both height and width. | ||
```js | ||
// resize the height to 250 and scale the width accordingly | ||
image.resize(Jimp.AUTO, 250); | ||
// resize the width to 250 and scale the height accordingly | ||
image.resize(250, Jimp.AUTO); | ||
``` | ||
### Resize modes | ||
The default resizing algorithm uses a bilinear method. | ||
Optionally, the following constants can be passed to choose a particular resizing algorithm: | ||
```js | ||
Jimp.RESIZE_NEAREST_NEIGHBOR; | ||
Jimp.RESIZE_BILINEAR; | ||
Jimp.RESIZE_BICUBIC; | ||
Jimp.RESIZE_HERMITE; | ||
Jimp.RESIZE_BEZIER; | ||
``` | ||
```js | ||
image.resize(250, 250, Jimp.RESIZE_BEZIER); | ||
``` |
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
227143
57