@jimp/utils
Utils for jimp extensions.
Last updated 3 years ago by alisowski .
MIT · Original npm · Tarball · package.json
$ npm install @jimp/utils 
SYNC missed versions from official npm registry.

@jimp/utils

Utils for jimp extensions.

Available Methods

isNodePattern

Determines if function was passed an node callback.

if (isNodePattern(cb)) {
  cb.call(this, null, this);
}

throwError

Either throws the error or calls the callback with the error.

if (/* check for error */) {
  return throwError.call(this, 'someError', cb);
}

scan

Scans through a region of the bitmap, calling a function for each pixel.

function removeRed(image) {
  return scan(image, 0, 0, image.bitmap.width, image.bitmap.height, function(
    x,
    y,
    index
  ) {
    const red = this.bitmap.data[index + 0];
    const green = this.bitmap.data[index + 1];
    const blue = this.bitmap.data[index + 2];
    const alpha = this.bitmap.data[index + 3];

    this.bitmap.data[index + 0] = 0;
    this.bitmap.data[index + 1] = green;
    this.bitmap.data[index + 2] = blue;
    this.bitmap.data[index + 3] = alpha;
  });
}

scanIterator

It's possible to make an iterator scan with a for ... of, if you want to break the scan before it reaches the end, but note, that this iterator has a huge performance implication:

for (const { x, y, idx, image } of scanIterator(
  image,
  0,
  0,
  image.bitmap.width,
  image.bitmap.height
)) {
}

Current Tags

  • 1.1.5--canary.d9590e7.0                                ...           canary (4 months ago)
  • 1.6.0                                ...           latest (4 months ago)

246 Versions

  • 1.6.0                                ...           4 months ago
  • 1.5.0                                ...           4 months ago
  • 1.4.0                                ...           4 months ago
  • 1.3.0                                ...           4 months ago
  • 1.2.0                                ...           4 months ago
  • 1.1.5                                ...           4 months ago
  • 1.1.5--canary.d9590e7.0                                ...           4 months ago
  • 1.1.4                                ...           4 months ago
  • 1.1.4--canary.3197852.0                                ...           4 months ago
  • 1.1.3                                ...           4 months ago
  • 1.1.3--canary.34e8f3b.0                                ...           4 months ago
  • 1.1.2                                ...           4 months ago
  • 1.1.1                                ...           4 months ago
  • 1.1.1--canary.8356674.0                                ...           4 months ago
  • 1.1.0                                ...           4 months ago
  • 1.0.5                                ...           4 months ago
  • 1.0.4                                ...           4 months ago
  • 1.0.3                                ...           4 months ago
  • 1.0.2                                ...           4 months ago
  • 1.0.2--canary.4e85de0.0                                ...           4 months ago
  • 1.0.1                                ...           4 months ago
  • 1.0.1--canary.1285.10648498431.0                                ...           4 months ago
  • 1.0.1--canary.1285.10648473476.0                                ...           4 months ago
  • 1.0.1--canary.1285.10648442015.0                                ...           4 months ago
  • 1.0.1--canary.1285.10648438081.0                                ...           4 months ago
  • 1.0.1--canary.1285.10648389420.0                                ...           4 months ago
  • 1.0.1--canary.1285.9477667080.0                                ...           6 months ago
  • 1.0.1--canary.1285.8595361640.0                                ...           9 months ago
  • 1.0.1--canary.1285.8595302168.0                                ...           9 months ago
  • 1.0.1--canary.1285.8595111491.0                                ...           9 months ago
  • 0.22.12                                ...           10 months ago
  • 0.22.11                                ...           10 months ago
  • 0.22.11--canary.c55989b.0                                ...           10 months ago
  • 0.22.10                                ...           a year ago
  • 0.22.9                                ...           a year ago
  • 0.22.8                                ...           2 years ago
  • 0.22.7                                ...           2 years ago
  • 0.22.6                                ...           2 years ago
  • 0.22.6--canary.1198.9324a88b87a1fc38b528af47ca707d97593dddaa.0                                ...           2 years ago
  • 0.22.5                                ...           2 years ago
  • 0.22.4                                ...           2 years ago
  • 0.22.4--canary.1187.30d10f964404705d383d7163b7d3f85baa2201b7.0                                ...           2 years ago
  • 0.22.3                                ...           2 years ago
  • 0.22.3--canary.1184.ff6583af74ba85d9555c36db2844886e269feb16.0                                ...           2 years ago
  • 0.22.2                                ...           2 years ago
  • 0.22.1                                ...           2 years ago
  • 0.22.1--canary.1173.30a931db5f6552c59e4c99f41fdb9e2b9ccf8291.0                                ...           2 years ago
  • 0.22.1--canary.1169.6db477d088d28aea43b31d9ca8b0eaf74dc511d1.0                                ...           2 years ago
  • 0.22.0                                ...           2 years ago
  • 0.21.4--canary.1163.d07ed6254d130e2995d24101e93427ec091016e6.0                                ...           2 years ago
  • 0.21.4--canary.1163.7b9287fff1036ae67190d5ea3a8dec9926373a63.0                                ...           2 years ago
  • 0.21.4--canary.1163.6a6ae39e83bd731ccd25120a160a75b32273f9bd.0                                ...           2 years ago
  • 0.21.4--canary.1163.a26f5b300ee88c2fadb9909dd390cb4380b32a42.0                                ...           2 years ago
  • 0.21.3                                ...           2 years ago
  • 0.21.2                                ...           2 years ago
  • 0.21.2--canary.1156.1f8a92bfc1cbc6b5f3ad2490d0ec86710c81f635.0                                ...           2 years ago
  • 0.21.2--canary.1156.ba9fec9d0c9109924b4a5acab31bcaef8159a610.0                                ...           2 years ago
  • 0.21.2--canary.1156.8b2cc45.0                                ...           2 years ago
  • 0.21.1                                ...           2 years ago
  • 0.21.1--canary.1153.3cc6d7b.0                                ...           2 years ago
  • 0.21.0                                ...           2 years ago
  • 0.21.0--canary.1149.a81f653.0                                ...           2 years ago
  • 0.21.0--canary.1149.3239903.0                                ...           2 years ago
  • 0.20.2                                ...           2 years ago
  • 0.20.1                                ...           2 years ago
  • 0.20.0                                ...           2 years ago
  • 0.19.0                                ...           2 years ago
  • 0.17.9--canary.1144.3455afd.0                                ...           2 years ago
  • 0.17.9--canary.1143.90575e6.0                                ...           2 years ago
  • 0.17.9--canary.fc042e5.0                                ...           2 years ago
  • 0.18.0                                ...           2 years ago
  • 0.17.9--canary.1141.cd4d455.0                                ...           2 years ago
  • 0.17.10                                ...           2 years ago
  • 0.17.9--canary.1140.e3ff49d.0                                ...           2 years ago
  • 0.17.9--canary.1140.4042b43.0                                ...           2 years ago
  • 0.17.9--canary.1140.831bc3c.0                                ...           2 years ago
  • 0.17.9                                ...           2 years ago
  • 0.17.8                                ...           2 years ago
  • 0.17.8--canary.1137.476d7bd.0                                ...           2 years ago
  • 0.17.7                                ...           2 years ago
  • 0.17.6                                ...           2 years ago
  • 0.17.6--canary.1137.5e459dc.0                                ...           2 years ago
  • 0.17.6--canary.cd893f3.0                                ...           2 years ago
  • 0.17.6--canary.1cb89cf.0                                ...           2 years ago
  • 0.17.5                                ...           2 years ago
  • 0.17.4                                ...           2 years ago
  • 0.17.3                                ...           2 years ago
  • 0.17.3--canary.1136.7f5f5d8.0                                ...           2 years ago
  • 0.17.2                                ...           2 years ago
  • 0.18.0--canary.1135.911ed04.0                                ...           2 years ago
  • 0.17.1                                ...           2 years ago
  • 0.17.1--canary.1134.e007a48.0                                ...           2 years ago
  • 0.17.1--canary.e22c14a.0                                ...           2 years ago
  • 0.18.0--canary.1133.54bf269.0                                ...           2 years ago
  • 0.17.0                                ...           2 years ago
  • 0.17.0--canary.1131.af3cb94.0                                ...           2 years ago
  • 0.16.13                                ...           2 years ago
  • 0.16.12                                ...           2 years ago
  • 0.16.11                                ...           2 years ago
  • 0.16.10                                ...           2 years ago
  • 0.16.9                                ...           2 years ago
  • 0.16.8                                ...           2 years ago
  • 0.16.7                                ...           2 years ago
  • 0.16.6                                ...           2 years ago
  • 0.16.5                                ...           2 years ago
  • 0.16.4                                ...           2 years ago
  • 0.16.3                                ...           2 years ago
  • 0.16.3-canary.993.1592.0                                ...           2 years ago
  • 0.16.3-canary.1045.1590.0                                ...           2 years ago
  • 0.16.3-canary.1082.1591.0                                ...           2 years ago
  • 0.16.3-canary.1040.1589.0                                ...           2 years ago
  • 0.16.3-canary.999.1588.0                                ...           2 years ago
  • 0.16.3-canary.1085.1581.0                                ...           2 years ago
  • 0.16.3-canary.1014.1579.0                                ...           2 years ago
  • 0.16.3-canary.1125.1580.0                                ...           2 years ago
  • 0.16.3-canary.1113.1404.0                                ...           2 years ago
  • 0.16.3-canary.1109.1388.0                                ...           2 years ago
  • 0.16.3-canary.1108.1382.0                                ...           2 years ago
  • 0.16.3-canary.1100.1371.0                                ...           2 years ago
  • 0.16.2                                ...           2 years ago
  • 0.16.2-canary.1087.1357.0                                ...           2 years ago
  • 0.16.2-canary.1094.1345.0                                ...           2 years ago
  • 0.16.2-canary.1093.1332.0                                ...           2 years ago
  • 0.16.2-canary.1086.1311.0                                ...           3 years ago
  • 0.16.2-canary.1084.1305.0                                ...           3 years ago
  • 0.16.2-canary.1082.1294.0                                ...           3 years ago
  • 0.16.2-canary.1080.1288.0                                ...           3 years ago
  • 0.16.2-canary.1073.1276.0                                ...           3 years ago
  • 0.16.2-canary.1070.1265.0                                ...           3 years ago
  • 0.16.2-canary.1052.1235.0                                ...           3 years ago
  • 0.16.2-canary.1051.1228.0                                ...           3 years ago
  • 0.16.2-canary.1045.1221.0                                ...           3 years ago
  • 0.16.2-canary.1016.1185.0                                ...           4 years ago
  • 0.16.2-canary.1008.1164.0                                ...           4 years ago
  • 0.16.2-canary.984.1126.0                                ...           4 years ago
  • 0.16.2-canary.969.1115.0                                ...           4 years ago
  • 0.16.2-canary.964.1101.0                                ...           4 years ago
  • 0.16.2-canary.956.1095.0                                ...           4 years ago
  • 0.16.2-canary.947.1077.0                                ...           4 years ago
  • 0.16.2-canary.938.1059.0                                ...           4 years ago
  • 0.16.2-canary.934.1053.0                                ...           4 years ago
  • 0.16.2-canary.919.1052.0                                ...           4 years ago
  • 0.16.1                                ...           4 years ago
  • 0.16.0                                ...           4 years ago
  • 0.15.1-canary.924.1021.0                                ...           4 years ago
  • 0.15.0                                ...           4 years ago
  • 0.14.1-canary.919.1005.0                                ...           4 years ago
  • 0.14.1-canary.911.993.0                                ...           4 years ago
  • 0.14.0                                ...           4 years ago
  • 0.14.0-canary.904.976.0                                ...           4 years ago
  • 0.13.0-canary.899.964.0                                ...           5 years ago
  • 0.13.0                                ...           5 years ago
  • 0.12.2-canary.899.952.0                                ...           5 years ago
  • 0.12.1                                ...           5 years ago
  • 0.12.1-canary.892.924.0                                ...           5 years ago
  • 0.12.0                                ...           5 years ago
  • 0.11.1-canary.891.908.0                                ...           5 years ago
  • 0.11.0                                ...           5 years ago
  • 0.10.5-canary.882.886.0                                ...           5 years ago
  • 0.10.4-canary.882.884.0                                ...           5 years ago
  • 0.10.4-canary.882.885.0                                ...           5 years ago
  • 0.10.3                                ...           5 years ago
  • 0.10.2                                ...           5 years ago
  • 0.10.2-canary.875.842.0                                ...           5 years ago
  • 0.10.1                                ...           5 years ago
  • 0.10.1-canary.870.821.0                                ...           5 years ago
  • 0.10.0                                ...           5 years ago
  • 0.9.9-canary.868.799.0                                ...           5 years ago
  • 0.9.9-canary.867.792.0                                ...           5 years ago
  • 0.9.8                                ...           5 years ago
  • 0.9.8-canary.866.767.0                                ...           5 years ago
  • 0.9.7                                ...           5 years ago
  • 0.9.7-canary.854.725.0                                ...           5 years ago
  • 0.9.6                                ...           5 years ago
  • 0.9.6-canary.860.700.0                                ...           5 years ago
  • 0.9.6-canary.857.681.0                                ...           5 years ago
  • 0.9.6-canary.858.667.0                                ...           5 years ago
  • 0.9.5                                ...           5 years ago
  • 0.9.4                                ...           5 years ago
  • 0.9.4-canary.845.627.0                                ...           5 years ago
  • 0.9.4-canary.841.620.0                                ...           5 years ago
  • 0.9.4-canary.838.613.0                                ...           5 years ago
  • 0.9.4-canary.832.606.0                                ...           5 years ago
  • 0.9.3-canary.825.599.0                                ...           5 years ago
  • 0.9.3                                ...           5 years ago
  • 0.9.3-canary.825.584.0                                ...           5 years ago
  • 0.9.2-canary.815.538.0                                ...           5 years ago
  • 0.9.1                                ...           5 years ago
  • 0.9.0                                ...           5 years ago
  • 0.8.6-canary.815.502.0                                ...           5 years ago
  • 0.8.6-canary.818.495.0                                ...           5 years ago
  • 0.8.6-canary.815.488.0                                ...           5 years ago
  • 0.8.6-canary.810.481.0                                ...           5 years ago
  • 0.8.5                                ...           5 years ago
  • 0.8.1-canary.791.466.0                                ...           5 years ago
  • 0.8.1-canary.789.460.0                                ...           5 years ago
  • 0.8.5-canary.799.447.0                                ...           5 years ago
  • 0.8.5-canary.1.b147e81.0                                ...           5 years ago
  • 0.8.5-canary.b147e81.0                                ...           5 years ago
  • 0.8.5-canary.753c2c9.0                                ...           5 years ago
  • 0.8.5-canary.800.426.0                                ...           5 years ago
  • 0.8.4                                ...           5 years ago
  • 0.8.4-canary.798.377.0                                ...           5 years ago
  • 0.8.3                                ...           5 years ago
  • 0.8.2-canary.792.360.0                                ...           5 years ago
  • 0.8.2-canary.792.353.0                                ...           5 years ago
  • 0.8.2-canary.792.349.0                                ...           5 years ago
  • 0.8.2-canary.792.339.0                                ...           5 years ago
  • 0.8.2-canary.792.332.0                                ...           5 years ago
  • 0.8.2                                ...           5 years ago
  • 0.8.2-canary.794.308.0                                ...           5 years ago
  • 0.8.1-canary.789.301.0                                ...           5 years ago
  • 0.8.2-canary.792.290.0                                ...           5 years ago
  • 0.8.2-canary.792.283.0                                ...           5 years ago
  • 0.8.1-canary.791.276.0                                ...           5 years ago
  • 0.8.1                                ...           5 years ago
  • 0.8.1-canary.786.262.0                                ...           5 years ago
  • 0.8.1-canary.786.242.0                                ...           5 years ago
  • 0.8.1-canary.786.232.0                                ...           5 years ago
  • 0.8.1-canary.786.223.0                                ...           5 years ago
  • 0.8.1-canary.786.217.0                                ...           5 years ago
  • 0.8.1-canary.786.211.0                                ...           5 years ago
  • 0.8.0                                ...           5 years ago
  • 0.7.1-canary.770.193.0                                ...           5 years ago
  • 0.7.0                                ...           5 years ago
  • 0.6.8                                ...           5 years ago
  • 0.6.8-canary.783.163.0                                ...           5 years ago
  • 0.6.7-canary.783.157.0                                ...           5 years ago
  • 0.6.7                                ...           5 years ago
  • 0.6.6                                ...           5 years ago
  • 0.6.5                                ...           5 years ago
  • 0.6.5-canary.784.124.0                                ...           5 years ago
  • 0.6.5-canary.784.118.0                                ...           5 years ago
  • 0.6.5-canary.eeb6481.0                                ...           5 years ago
  • 0.6.5-canary.4564f3c.0                                ...           5 years ago
  • 0.6.4                                ...           6 years ago
  • 0.6.0                                ...           6 years ago
  • 0.5.0                                ...           6 years ago
  • 0.4.0                                ...           6 years ago
  • 0.3.9                                ...           6 years ago
  • 0.3.9-alpha.0                                ...           6 years ago
  • 0.3.8                                ...           6 years ago
  • 0.3.7                                ...           6 years ago
  • 0.3.6                                ...           6 years ago
  • 0.3.6-alpha.6                                ...           6 years ago
  • 0.3.6-alpha.5                                ...           6 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE