shahriyardx / easy-pil

A library to make common tasks of Pillow easy.
https://easy-pil.readthedocs.io/
MIT License
41 stars 15 forks source link

Feature/workspace #20

Closed shahriyardx closed 1 year ago

shahriyardx commented 1 year ago

Added workspace support

Example:

from easy_pil import Editor, Workspace

space = Workspace((200, 200))
space.create_layer("background", "black")
space.update_layer("background", new_layer_name="good")
space.set_working_layer("good")

space.add_component(
    identifier="cube",
    func=Editor.rectangle,
    options={
        "position": (0, 0),
        "color": "red",
        "width": 100,
        "height": 100,
    },
)
space.generate_image().show()