PowerOf2ImageResizer
PowerOf2ImageResizer copied to clipboard
Length/Width independent
Would it be possible to have the width and height considered independently so that the output isn't always square? I see there is another fork that does that (specific to toontown), but I'm wondering if it can be included in the installer so I can continue to use the shell extension.
For my custom fork, I did the get_closest function separately for both the width/height values:
def po2(im):
name = im.filename
width, height = im.size
new_dimX = get_closest(width)
new_dimY = get_closest(height)
# ...
return im.resize((new_dimX, new_dimY))
This current branch does:
def po2(im, ...):
new_dim = max(get_closest(width), get_closest(height))
# ...
return im.resize((new_dim, new_dim), resample=Image.BICUBIC)
For my custom fork, I did the
get_closestfunction separately for both the width/height values:def po2(im): name = im.filename width, height = im.size new_dimX = get_closest(width) new_dimY = get_closest(height) # ... return im.resize((new_dimX, new_dimY))This current branch does:
def po2(im, ...): new_dim = max(get_closest(width), get_closest(height)) # ... return im.resize((new_dim, new_dim), resample=Image.BICUBIC)
Thanks. I saw that, and that's similar to the changes I made myself. I excluded the color profile changes and kept the full spectrum of sizes.
Does the new fork include that in the installation package though? I find the shell extension functionality incredibly useful and am not familiar enough with compiling python to figure it out. I originally thought that editing the python script before running the install would implement it, but it appears they are not connected.