Package Exports
- image-to-ascii
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (image-to-ascii) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Image to ASCII
Node.js module that converts an image to ASCII art.
How to use
Constructor: new ImageToAscii (options)
options
is an object containing the following fields:
pixels
: string representing the ASCII pixels in the brightness order. If not provided, the default value will be used:" .,:;i1tfLCG08@"
multiplyWidth
: the width of the ASCII pixles. For keeping the aspect ratio in terminal, the default value is2
reverse
: boolean value that indicates if thepixels
value must be reversed. Default isundefined
.colored
: boolean value that indicates if the ASCII art must be colored or not. Default isundefined
.
.convert (imagePath, callback)
imagePath
: the path to the PNG imagecallback
: the callback function
Example
var ImageToAscii = require ("../index")
, myImage = new ImageToAscii ({
resize: {
height: "100%"
, width: "50%"
}
, multiplyWidth: 1
, colored: true
})
;
myImage.convert(__dirname + "/octocat.png", function(err, converted) {
console.log(err || converted);
});
Baracktocat + image-to-ascii
= Nice ASCII art 😃
Test
Changelog
v0.1.1
- Added support for images from Internet
v0.1.0
- Initial version
License
See LICENSE file