将多个不同大小或格式的图像打包到一个图像中。
image-packer的Python项目详细描述
LicenseBuild StatusPyPI versionPyversions
图像打包机
关于
将多个不同大小或格式的图像打包到一个图像中。
-支持的图像输入格式:-PNG、BMP、JPG-支持的图像
输出格式:-PNG(24位或32位)
阿特拉斯
兼容性
image_packer适用于python 3.4或更高版本。
依赖性
- 枕头
安装
pip install image-packer
使用量
fromimage_packerimportpackerworkpath='./image'input_filepaths=[workpath+'/*.png',workpath+'/*.jpg',workpath+'/*.bmp',]output_filepath=workpath+'/atlas.png'container_width=128options={'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
许可证
此软件是在麻省理工学院的许可下发布的,请参阅许可证。