A small script to help make graphic files for NightGFX, the OpenTTD graphic baseset
main.py currently automatically makes, from an 8bpp sprite
- 32bpp sprite with transparent backgrounds and desaturated company color 1 (cc1) & company color 2
- 8bpp mask files with palette, that replace cc1 with color index 202 and preserves following colors:
- 232-238 Fire Cycle
- 239-240 Flashing Red
- 241-244 Flashing Yellow
main function is named process_image
, set automatic_lights = True
to have it automatically attempt to convert windows to lights and darken the image
dependencies: pillow, numpy
usage:
- install Python on your computer
- open your terminal
- download pillow and numpy by running these commands
pip install pillow
pip install numpy
- download the script main.py and move it to the folder where you have images
- find the folder this script is located in and go to it in terminal with this command:
cd path/to/your/folder
(replace path/to/your/folder with your folder)
- run this script
python main.py
- this script will ask you which image to process. Write the name of the file. Example:
infra06
infra06.png
- make sure the image and the script are in the same folder
- enjoy your new files
- they will be at
infra06--mask.png
andinfra06--32bpp.png
if your file wasinfra06.png
- they will be at