Skip to main content

A software to create images from a yaml template

Project description

ImageCreator

A python package that lets you create image templates. It can be used with self coded plugins to produce dynamically changing images with the same template.

Installation

Download

  1. Download the repository as a Zip-file
  2. Unzip the repository to a desired directory
  3. You may need to rename the repository to ImageCreator.

PIP

pip package is coming soon!

Usage

  1. using VS Code as text editor for this is recommended

  2. Create this run.py file (within the directory where you saved the ImageCreator if not installed with PIP):

    # run.py
    import ImageCreator
    
    ImageCreator.start()
    
  3. Run the run.py file. It will create a structure like this when first executed:

    root
    ✠(ImageCreator)
    ✠Assets
    |  ✠fonts
    |  |  â”” _fonts.py
    |  ✠images
    |  â”” plugins
    ✠CreateConfigurations
    |  â”” created_images
    â”” run.py
    
  4. Create a template with the template editor GUI

Using the template editor GUI

  1. Select file button:
    Select a configuration file in the file dialog that you want to edit.
  2. Stay on top checkbox:
    Make the window stay on top of all other windows (useful when you are editing a configuration file).
  3. Auto refresh checkbox: Make the image refresh automatically to directly see your changes.
  4. Refresh Button:
    Refresh the image manually (recommended for slower PCs).
  5. Add File/Add Overlay Button When no file is selected, you can click on the button to create and save a new configuration file.
    When there is a file selected, you can add overlays to an image object with: a: OVERLAY_KEYWORD
    Overlay keywords:
    image or img to add an image overlay
    text or txt to add a text overlay
    multiline_text or multiline or multi or mtxt to add a multiline text overlay

When you have a configuration file selected or created, you can open it in VS Code and edit it. When you activate Auto Save in VS Code and Auto Refresh in the GUI, you can see what your changes did directly.

Additional Features

Fonts:

You can put fonts in .ttf or .otf format inside the root/Assets/fonts directory so that you can use them.

Images:

You can put images inside the root/Assets/images directory so that you can use them as an overlay, or the background.

Plugins:

Plugins can be used to add anything (for example text) to the image at the time of its creation. Add them to your configuration file like this:

# your_configuration.yaml
...
message:
    plugin: YOUR_PLUGIN
    kwargs:
        KEYWORD: ARGUMENT

... OR ...

message: {plugin: YOUR_PLUGIN, kwargs: {KEYWORD: ARGUMENT}}

They can be used with keyword arguments if needed, and even get their keyword arguments trough another plugin.
Plugins need to be in the root/Assets/plugins directory and need to have a run method, that returns the desired output.

# example_plugin.py
import time

def run():
    time_now = time.ctime()
    return time_now

Callable with: {plugin: example_plugin}
Example Output: Tue Jun 8 13:32:09 2021



# example_plugin2.py

def run(name):
    sentence = f"Hello {name}, have a great day!"
    return sentence

Callable with: {plugin: example_plugin2, kwargs:{name: Peter Griffin}}
Example Output: Hello Peter Griffin, have a great day!



Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Notes

This is my very first attempt to publish something to github, so I am still learning and always open for feedback. If you think there is something I could do better or if you want to cooperate, feel free to contact me at: enocyzed@gmail.com

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ImageCreator-0.0.2.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ImageCreator-0.0.2-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file ImageCreator-0.0.2.tar.gz.

File metadata

  • Download URL: ImageCreator-0.0.2.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for ImageCreator-0.0.2.tar.gz
Algorithm Hash digest
SHA256 23a2df32c842f955f731631b632104fa2a6eb4a9fac0a4e97755c512768996b6
MD5 f30e6d9e1f1d917f2e6d400b2ce04c0c
BLAKE2b-256 091e9f7d8468ffbd99d8a3634090617448ff8df055ccfa738d336824de4ef0f0

See more details on using hashes here.

File details

Details for the file ImageCreator-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: ImageCreator-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for ImageCreator-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5e931e92fe0fa27dd6ef851ef9c0f843bd14a3d3fb1fd6ed3bf789d51739dbb5
MD5 a034ad9a23b7f8ffeb1e6643268af1b6
BLAKE2b-256 ab615e9635c5d37e64d5a3f8127dd3b25ab22c8abb5090b5e28638c3305c4350

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page