diff --git a/README.md b/README.md index 77b506688..ad2568b11 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Once the callback has fired, the following methods can be called on the image: image.contrast( val ); // adjust the contrast by a value -1 to +1 image.posterize( n ); // apply a posterization effect with n level image.mask( src, x, y ); // masks the image with another Jimp image at x, y using average pixel value - image.dither64(); // ordered dithering of the image and reduce color space to 64-bits (RGB565) + image.dither565(); // ordered dithering of the image and reduce color space to 16-bits (RGB565) (Contributions of more methods are welcome!) diff --git a/jimp.js b/jimp.js index bd64a8712..804eed2fb 100644 --- a/jimp.js +++ b/jimp.js @@ -960,7 +960,7 @@ Jimp.prototype.getBuffer = function (mime, cb) { * @param (optional) cb A callback for when complete * @returns this for chaining of methods */ -Jimp.prototype.dither64 = function (cb) { +Jimp.prototype.dither565 = function (cb) { var rgb565_matrix = [ 0, 4, 1, 5, 0, 4, 1, 5, 6, 2, 7, 3, 6, 2, 7, 3, @@ -984,6 +984,9 @@ Jimp.prototype.dither64 = function (cb) { else return this; } +// alternative reference +Jimp.prototype.dither16 = Jimp.prototype.dither565; + /** * Writes the image to a file * @param path a path to the destination file (either PNG or JPEG) diff --git a/test/callbacks.js b/test/callbacks.js index c39e7fc3b..dca96ebed 100644 --- a/test/callbacks.js +++ b/test/callbacks.js @@ -15,7 +15,7 @@ var operations = { "brightness": [0.75], "contrast": [0.75], "posterize": [5], - "dither64": [] + "dither565": [] }; for (var op in operations) process(op); diff --git a/test/chained.js b/test/chained.js index 2c9e9437d..6c7d635be 100644 --- a/test/chained.js +++ b/test/chained.js @@ -61,7 +61,7 @@ var lenna = new Jimp("lenna.png", function (err) { lenna.clone().mask(mask, 0, 0).write("./output/lenna-mask.png"); }); - this.clone().dither64().write("./output/lenna-64-bit.png"); + this.clone().dither565().write("./output/lenna-565-bit.png"); });