I am using jimp to manipulate the image. Everything is working fine but when I am creating a new image with
new Jimp(256, 256, (err, image) => {
// this image is 256 x 256, every pixel is set to 0x00000000
});
every pixel is set to 0x00000000
I need no background color image (it need to be transparent), How can I achieve this?
Edit : when I am sending a png image then it is giving me a transparent image,when the third argument is not passed when the third argument is not passed. And jpeg is giving me black. And I am also manipulating image before sending or showing
Thanks for help.
You should try this, as the last 2 digits of the color represent the alpha channel:
Or you can use a css color format:
new Jimp(256, 256, '#000000ff', (err, image) => {
});
As explained here:
User contributions licensed under CC BY-SA 3.0