Custom Texture Packer with PIL; Part 1


Tue Nov 08 2022 14:09:27 GMT+0000 (UTC)

Saved by @MaVCArt #python

from PIL import Image

class RGBAPacker(object):
    def process(self, output_file, inputs=None):
    	# -- we assume "inputs" is a dictionary of image files, with the keys corresponding to the channels they want packing in.
    	inputs = inputs or dict()
    	r ='r')).convert('L')
        g ='g')).convert('L')
        b ='b')).convert('L')
        a ='a')).convert('L')
        output = Image.merge('RGBA', r, g, b, a)