Pack multiple images of different sizes or formats into one image.
- Supported image input formats:
- png, bmp, jpg
- Supported image output formats:
- png(24 or 32bits)
image_packer works with Python 3.4 or higher.
- Pillow
pip install image-packer
from image_packer import packer
workpath = './image'
input_filepaths = [
workpath + '/*.png',
workpath + '/*.jpg',
workpath + '/*.bmp',
]
output_filepath = workpath + '/atlas.png'
container_width = 128
options = {
'margin': (1, 1, 1, 1),
'collapse_margin': False,
'enable_auto_size': True,
'enable_vertical_flip': True,
'force_pow2': False
}
packer.pack(
input_filepaths=input_filepaths,
output_filepath=output_filepath,
container_width=container_width,
options=options
)
$ impack -i "./image/*.png" -i "./image/*.jpg" -i "./image/*.bmp" -o "./image/atlas.png" -w 128 -m 1 1 1 1
This software is released under the MIT License, see LICENSE.