Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python3
- import sys
- from PIL import Image
- if len(sys.argv) > 1:
- name = sys.argv[1]
- with Image.open(name) as input_image:
- rgba_image = input_image.convert('RGBA')
- rgb_image = rgba_image.convert('RGB')
- alpha_image = rgba_image.split()[-1]
- base_name = ".".join(name.split(".")[:-1])
- rgb_image.save(base_name + "_n.tga")
- alpha_image.save(base_name + "_h.tga")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement