Options
All
  • Public
  • Public/Protected
  • All
Menu

ImageScript generated overlay

ImageScript generated overlay

// Load both the users avatar and the overlay
const [image, overlay] = Image.loadMultiple(
    ['https://cdn.discordapp.com/avatars/687945863053443190/43022bb80ae031830866caacc18312de.png?size=1024',
    'https://i1.wp.com/freepngimages.com/wp-content/uploads/2014/11/christmas-santa-hat.png?w=500']
);

// Resize the overlay to fit the avatar
overlay.resize(image.width, Image.RESIZE_AUTO);

// Composite the overlay onto the image
image.composite(overlay, image.width / 12, -image.height / 2.5);

Functions used

Image.loadMultiple
Image.resize
Image.composite