Open pdr0663 opened 7 years ago
Hi, I don't think its necessary. You can do it via some wrapper like:
function mkImg(width, height) {
const blackPxl = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQImWNgYAAAAAMAAaCmo9QAAAAASUVORK5CYII=';
const buff = new Buffer(blackPxl, 'base64');
return new PngImg(buff).setSize(width, height);
}
Not quite as elegant as:
var img = new png-img(width, height);
Agree, but png-img was designed for work with existing images. And I don't think such constructor will be added in near future
Could we please have a constructor which receives width and height as arguments and returns a blank image?
Paul