Imagix
Imagix is a framework for jimp to manipulate images in a simpler and cleaner way.
Installation
$ npm install --save imagix
Example usage
// references the classes to useconst ImagixRead ImagixFont ImagixImage = ; // create a new font to print, use the ImagixFont classlet text1 = 'text to print' 20 100 // text a print, point in X, point in Y //Options for a font size: 32 // size of the font color: 'WHITE' // color of the font ; // create a new image to print, use the ImagixImage classlet img1 = 'avatar.png' //Options for a image x: 15 // point in X y: 45 // point in Y resizeX: 130 //define the size in X of the image. resizeY: 120 //define the size in Y of the image. ; /* The ImagixRead class takes the fonts and images in arrays and returns the getBuffer method. */ const image = 'image-bg.png' text1 img1;// image to manipulation image-bg.png// if you have more than one font "[text1, text2, text3]" or images "[img1, img2]" //Metods options getBuffer, getWrite, getInks//print image manipulation //getWriteimage; //getBufferimage; //getInks, opts for all Jimp's methodsimage
OPTIONS A FONT
//Available options size: "8" //Open Sans, 8px "16" //Open Sans, 16px "32" //Open Sans, 32px "64" //Open Sans, 64px "128" //Open Sans, 128px color: "BLACK" //Open Sans, Black"WHITE" //Open Sans, White
SUMMARIZED EXAMPLE
const ImagixRead ImagixFont ImagixImage = ; let nick = 'Nickname' 20 100 size: 32 color: 'WHITE' ; let info = 'name@gmail.com' 20 300 size: 16 color: 'BLACK' ; let avatar = 'www.example.com/asset/avatar.png' x: 15 y: 45 resizeX: 250 resizeY: 230 ; const image = 'bg-profile-1.png' nick info avatar; image; //Orimage;