Fork me on GitHub

Python Image generating script

A helpful tool for those in need of a large number of different images, with various sizes. Check out the Github page for the code, my blog post for some insights or just read the instructions below.


How to use it

After you download the archive from Github or just the backup script itself, you have to configure the config.json file by hand or you can use the online configurator.
All you have to do next is run python


This is how the sample config file looks like:

    "settings": {
        "total_images": 1,
        "output_path": "output",
        "filename": "sample_##index",
        "zfill": true,
        "format": "JPEG",
        "quality": 100,
        "background_color": "#000000",
        "size": {
            "width": 200,
            "height": 200,
            "ratio": 1
        "text": "(##width x ##height)",
        "text_size": 20,
        "text_color": "#FFFFFF",
        "text_position": "center"

Running the script

Open a terminal window and navigate to the location of the file. Then run python and watch the magic happen!
py-image-generator script screenshot