This script can transfer an image into a blueprint of space platform for the Factorio:SpaceAge.
Original image:
Result in the game:
python main.py <file_path> [options]
File Path
(required): The path to the image you want to process.
-
-W, --width
(optional): The desired width of the image after conversion. If only this parameter is provided, the height will be automatically calculated to maintain the aspect ratio of the original image. -
-H, --height
(optional): The desired height of the image after conversion. If only this parameter is provided, the width will be automatically calculated to maintain the aspect ratio of the original image. -
-I, --invert
(optional): If specified, this option will invert the colors of the image. -
-T, --threshold
(optional): The threshold value for grayscale conversion, an integer between 0 and 255 (inclusive). The default value is 128. -
'-F', --fill_holes
(optional): If specified, the script will fill all holes inside space platform.
- Convert an image to grayscale with a custom threshold and invert the colors:
python main.py path_to_image.jpg -T 200 -I
- Resize the image to a width of 300px, with the height automatically adjusted to maintain the aspect ratio:
python main.py path_to_image.png -W 300
Convert the image with a custom threshold, filling the holes, but maintain the original size:
python main.py path_to_image.png -T 180 -F