Fixed two generation
This commit is contained in:
@@ -186,11 +186,11 @@ bot.login("super_secret_token")
|
|||||||
|
|
||||||
- ``new DIG.Rip().getImage(`<Avatar>`);``
|
- ``new DIG.Rip().getImage(`<Avatar>`);``
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- ``new DIG.Spank().getImage(`<Avatar>`, `<Avatar2>`);``
|
- ``new DIG.Spank().getImage(`<Avatar>`, `<Avatar2>`);``
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- ``new DIG.Stonk().getImage(`<Avatar>`);``
|
- ``new DIG.Stonk().getImage(`<Avatar>`);``
|
||||||
|
|
||||||
@@ -229,6 +229,10 @@ bot.login("super_secret_token")
|
|||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v1.3.8
|
||||||
|
- Edited the Rip() image
|
||||||
|
- Fixed the Spank() colors
|
||||||
|
|
||||||
## v1.3.4
|
## v1.3.4
|
||||||
- Added bobross()
|
- Added bobross()
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "discord-image-generation",
|
"name": "discord-image-generation",
|
||||||
"version": "1.3.7",
|
"version": "1.3.8",
|
||||||
"description": "discord-image-generation is a powerfull module that allow you to generate awesome images.",
|
"description": "discord-image-generation is a powerfull module that allow you to generate awesome images.",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 188 KiB After Width: | Height: | Size: 579 KiB |
@@ -1,5 +1,4 @@
|
|||||||
const Canvas = require("canvas");
|
const Canvas = require("canvas");
|
||||||
const jimp = require("jimp");
|
|
||||||
|
|
||||||
module.exports = class Rip {
|
module.exports = class Rip {
|
||||||
/**
|
/**
|
||||||
@@ -9,12 +8,12 @@ module.exports = class Rip {
|
|||||||
|
|
||||||
async getImage(image) {
|
async getImage(image) {
|
||||||
if (!image) throw new Error(`You must provide an image.`);
|
if (!image) throw new Error(`You must provide an image.`);
|
||||||
const canvas = Canvas.createCanvas(244, 253);
|
const canvas = Canvas.createCanvas(720, 405);
|
||||||
const ctx = canvas.getContext(`2d`);
|
const ctx = canvas.getContext(`2d`);
|
||||||
const background = await Canvas.loadImage(`${__dirname}/../../assets/rip.png`);
|
const background = await Canvas.loadImage(`${__dirname}/../../assets/rip.png`);
|
||||||
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
|
|
||||||
const avatar = await Canvas.loadImage(image);
|
const avatar = await Canvas.loadImage(image);
|
||||||
ctx.drawImage(avatar, 63, 110, 90, 90);
|
ctx.drawImage(avatar, 110, 47, 85, 85);
|
||||||
|
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
|
||||||
return canvas.toBuffer();
|
return canvas.toBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -14,6 +14,8 @@ module.exports = class Spank {
|
|||||||
image2 = await jimp.read(image2);
|
image2 = await jimp.read(image2);
|
||||||
image1.circle();
|
image1.circle();
|
||||||
image2.circle();
|
image2.circle();
|
||||||
|
image1.greyscale();
|
||||||
|
image2.greyscale();
|
||||||
bg.resize(500, 500);
|
bg.resize(500, 500);
|
||||||
image1.resize(140, 140);
|
image1.resize(140, 140);
|
||||||
image2.resize(120, 120);
|
image2.resize(120, 120);
|
||||||
|
Reference in New Issue
Block a user