BoD - mmp files convert(Python program) 中文文档
July 2019 by Sryml
There are 3 mmp programs on the current network:
-
RAS's BaB
It seems that it can't package 32bpp images, and it can only be packaged and cannot be unpacked. -
mmp_dump
The command line starts, it can only unpack and can not be packaged, can not unpack 32bpp images. -
SGIMMPWorkstation
By SGI. All features are perfect.
packing/unpacking/deleting/adding/generating dat... support 8/24/32bpp, is a very convenient software.
The only drawback is batch processing.
I hope there is something that can be handled in a more convenient way, so mmp_convert
was born.:sunglasses:
- mmp_convert.py
packing/unpacking/deleting/adding/generating dat/convert bpp/convert format... support 8/24/32bpp, batch automation and multi-process.
The most important thing: the python environment
- You need a Python environment (I use python 3.7)
- Check if you have pip installed
Enterpip --version
in cmd - Install third-party library PIL
Enterpip install Pillow
in cmd - Drag the file or folder you want to process to the
.bat
file
P.s. Adjust the variable CPU_COUNT
in the mmp_convert.py
file to reduce cpu usage.
- bmp, jpeg, png, webp
- Unpacking MMP
- 1 required parameter
--path
: File or folder paths. - 1 optional parameter
--bpp
: 8/24/32, default bpp from the original mmp.
- Pack/add images to MMP
- 1 required parameter
--path
: File or folder paths. - 2 optional parameter
--bpp
: 8/24/32, default bpp from the original image.
-y
: overwrite, no -y does not overwrite.
- Convert MMP to other bpp
- 1 required parameter
--path
: File or folder paths. - 3 optional parameter
--bpp
: 8/24/32, default 8.
-max
: resolution(Allow the largest edge, ignoring the image below the maximum).
-y
: overwrite, no -y does not overwrite.
- Generate a list of names to dat
- 1 required parameter
--path
: File or folder paths.
- Delete images in mmp file
- 1 required parameter
--path
: File path. - Enter multiple numbers separated by spaces to delete images.
- Image format convert
- 2 required parameter
--path
: File or folder paths.
--output
: Output format. - 5 optional parameter
--bpp
: 8/24/32/Alpha, default bpp from the original image.
-max
: resolution(Allow the largest edge, ignoring the image below the maximum).
--scale
: Zoom factor, such as4x
or0.25x
.
--quality
: JPG image quality, default is 95.
-y
: overwrite, no -y does not overwrite.
- Files Unification
Uniform name/Uniform format/File remapping - 1 required parameter
--path
: File or folder paths. - 2 optional parameter
--format
: File format
-kl
: Extract the file in the specified format and maintain the directory hierarchy; otherwise give the file a unique ID and move to the same directory
Uniform format:
None
- Image channel conversion (RGB and BGR)
- 1 required parameter
--path
: File or folder paths. - 1 optional parameter
--quality
: JPG image quality, default is 95.
[+]
Added functionswapBGR
- Image channel conversion.
[^]``toImg
increases the image quality optional parameter quality
(applies to JPG format).
[+]
Added function StdUnify
- Files Unification(Uniform name or uniform format).
[+]
Increase the toImg
function's parameter --scale
, scale the image proportionally.
[^]
Fix tobpp
MMP files of the same bpp cannot convert resolution.
[+]
Added function remove
- Delete images in mmp file.
[+]
Added function toImg
- Image format convert.
[+]
Added font color, green progress bar.
[^]
Fixing images with Alpha directly converted to 8bpp causes distortion (first converted to 24bpp and then to 8bpp).
[^]
Improve pre-parsed files.
[^]
Other code modifications.
- The mmp_convert program provides four functions
unpacking, packing, tobpp, todat - Support multi-process to quickly process files.
- If the error
Command line is too long
, it is because there are too many files selected. Put these files in a folder and drag the folder to handle it. The result of this is that only one parameter folder path is passed.