I made this to help with the workflow of quickly cropping and enhancing images
pyimg has built in submodules such as Transform, Operations, Adjustments and Filters. To use the transform submodule just run the command:
$ python -m pyimg IMAGE_FILE transform METHOD
IMAGE_FILE
being the image you wish to change and METHOD
being the method you want to use. To view avalible methods read the docs
You can do the same thing above for the Filters submodule
Some methods you will see require arguments, you can pass these in after the method just seperated by a space
$ python -m pyimg IMAGE_FILE transform METHOD foo bar
To view docs first install mkdocs with pip
or conda
then run python -m mkdocs serve
You can create plugins just create a new .py
file in the plugins
folder.
In that file first import the plugins API
from plugins import BasePlugin
next create a class and have it inherit from BasePlugin
with a blank constructor
class Foobar(BasePlugin):
def __init__(self):
pass
now you are free to add any method you want just make sure: it has the decorator @staticmethod
, the first argument is the image being edited (a PIL Image class) and, returns the image at the end
Example:
@staticmethod
def print_width(image):
print(image.width)
return image