20 lines
560 B
JavaScript
20 lines
560 B
JavaScript
const Jimp = require('jimp');
|
|
|
|
async function checkCorners() {
|
|
const img = await Jimp.read('Icon.png');
|
|
const w = img.bitmap.width;
|
|
const h = img.bitmap.height;
|
|
|
|
const tl = Jimp.intToRGBA(img.getPixelColor(0, 0));
|
|
const tr = Jimp.intToRGBA(img.getPixelColor(w - 1, 0));
|
|
const bl = Jimp.intToRGBA(img.getPixelColor(0, h - 1));
|
|
const br = Jimp.intToRGBA(img.getPixelColor(w - 1, h - 1));
|
|
|
|
console.log('Top-Left:', tl);
|
|
console.log('Top-Right:', tr);
|
|
console.log('Bottom-Left:', bl);
|
|
console.log('Bottom-Right:', br);
|
|
}
|
|
|
|
checkCorners();
|