Command line tool which takes a bunch of images, and outputs a JPEG combining the images using a weighted average where the weights are samples drawn from the Dirichlet distribution.
$ average-pixels download "party explosions boom" --offset 90 --count 30
$ python3 -m pip install average-pixels
The application in download
mode uses Bing Search API to search for images so it requires the user to have an API key activated for Bing's search service. To obtain one:
- Create a Microsoft account if you don't have one
- Get an API key for the Bing Image Search Service
Once obtained, the key may be provided through various methods:
- When prompted by the application
- By storing it in
~/.average_pixels_api
- Or via the
AVERAGE_PIXELS_API
environment variable (e.g.$ export AVERAGE_PIXELS_API=$key
)
The application has 2 modes:
local
: Combines local files and outputs the combined imagedownload
: Takes keywords from the user, and combines images from Bing Image Search
$ average-pixels download "black cats"
$ average-pixels download "green field blue sky"
$ average-pixels download "just give me some random photo"
$ average-pixels download "no"
$ average-pixels download "insects" --count 30
$ average-pixels local /tmp/average_images --offset 40
$ average-pixels download "turner" --count 20
$ average-pixels download "jackson pollock painting" --count 10 --offset 30
$ average-pixels download "green" --count 100
$ average-pixels local images/