Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- from PIL import Image
- cape_path = "cape.png"
- mode = 2
- size = int("100")
- cape_img = Image.open(cape_path)
- cape_width, cape_height = cape_img.size
- cape_ratio = cape_height / 64
- output_img = Image.new("RGBA", (int(10 * cape_ratio), int(16 * cape_ratio)), (255, 255, 255, 127))
- output_img.paste(cape_img.crop((int(1 * cape_ratio), int(1 * cape_ratio), int(11 * cape_ratio), int(17 * cape_ratio))), (0, 0))
- output_size = (size, int(size * 1.6))
- resized_img = output_img.resize(output_size)
- resized_img.save("output.png", "PNG")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement