Pocket Plane Group

Miscellany, Inc. => Infinity Engine Modding Q&A => Topic started by: Avenger_teambg on April 04, 2013, 11:48:57 AM

Title: bamresizer stuff
Post by: Avenger_teambg on April 04, 2013, 11:48:57 AM
Yeah, i know this is old, but i just recently had to use this.
A few things:

1. bamresize.py has a commented out line in its end #main() - uncomment, if you want to run a modified bamresize.py
2. a correct resizeFrame function would be this:

Code: [Select]
    def resizeFrame (self, percent, PILPalette,
                     width, height, data, centerX, centerY):
        im = Image.fromstring("P", (width, height), data)
        im.putpalette(PILPalette)
        if width > 1 and height > 1:
            width = width * percent / 100
            height = height * percent / 100
            im2 = im.resize ((width, height))
            data = im2.tostring()
            centerX = centerX * percent / 100
            centerY = centerY * percent / 100
        return width, height, data, centerX, centerY
Title: Re: bamresizer stuff
Post by: Cuv on April 04, 2013, 11:51:40 AM
Very nice,  that will be useful!!