Averages a single image into RGB color values. Returns a dictionary with the following keys: name, red, green, blue
image- filename (string), pathlib.Path object or a file object. The file object must implementread(),seek(), andtell()methods, and be opened in binary mode.name- auto generated from image path by callingimage.split(os.sep)[-1]unless set.downsample- chooses if downsampling is enabled to speed up processing. Enabled by default.max_size- max length of longest side ifdownsampleis Truealpha_threshold- level at which transparent pixels are excluded from the average. Default is 245
Averages each individual image in a directory and returns a list with an entry for each image successfully averaged. Returns a list containing a dictionary for each image with the following keys: name, red, green, blue
dir_in- path to directory
Averages all images in a directory to a singular RGB directory average. Returns a dictionary with the following keys: name, red, green, blue
dir_in- path to directoryname- auto generated from directory path by callingdir_in.split(os.sep)[-1]unless set.
Accepts the path to a directory and walks all the enclosed directories calling average_directory for each one that contains images. Returns a list containing a dictionary for each directory with the following keys: name, red, green, blue
root_dir- path to starting directory
- add usage examples to readme
- add information for loadsave functions to readme
Testing is done with pytest
Run with python3 setup.py test