const jimp = require("jimp");

module.exports = class Beautiful {
    /**
     * Beautiful
     * @param {image} image 
     */
    async getImage(image) {
        if (!image) throw new Error("You must provide an image.");
        let base = await jimp.read(`../src/module/assets/beautiful.png`);
        base.resize(376, 400);
        let img = await jimp.read(image);
        img.resize(84, 95);
        base.composite(img, 258, 28);
        base.composite(img, 258, 229);
        let raw;
        base.getBuffer("image/png", (err, buffer) => {
            raw = buffer;
        });
        return raw;
    }
}