Browse Source

minimal readme, example config file

master
Gator 2 years ago
parent
commit
f89a309410
  1. 5
      .gitignore
  2. 3
      README.md
  3. 15
      config.py.example
  4. 6
      ex.py
  5. 2
      requirements.txt

5
.gitignore

@ -0,0 +1,5 @@
venv
__pycache__
*.pyc
config.py

3
README.md

@ -0,0 +1,3 @@
# Serial Pillow Experiments
Old Python project using Pillow to generate pictures by blending and morphing other ones randomly. Slow but fun and handy to generate cover art.

15
config.py.example

@ -0,0 +1,15 @@
"""
Image processing and medias constants
FOLDERS : Folders in which processed images are stored
OUTPUT_FOLDER : Where generated images are saved
BLENDING : Blending methods
EFFECTS : List of effect to possibly use during generation
SPECIAL : Custom process to give a special look to the generated image
"""
FOLDERS = ['/home/foo/Images/archi',
'/home/foo/images/botanica']
OUTPUT_FOLDER = '/home/foo/images/autogenerated/'
BLENDING = ['multiply', 'screen', 'subtract']
EFFECTS = ['filter', 'enhance', 'mirror', 'color', 'detail']
SPECIAL = ['deform', 'lsd', 'akira']

6
ex.py

@ -10,9 +10,9 @@ EFFECT_TECH = ['filter', 'enhance', 'mirror', 'color', 'detail']
# return a random folder path in the local media folder
def get_folder():
l = config.FOLDERS
flist = config.FOLDERS
# return listdir(l)[random.randrange(len(listdir(l)) - 1)] + '/'
return l[random.randrange(len(l)) - 1] + '/'
return flist[random.randrange(len(flist)) - 1] + '/'
# return a (random) file path
@ -175,7 +175,7 @@ def test3():
il = resize(get_img_list())
default_size = (1080, 1080)
img = Image.new('RGBA', default_size)
filename = str(round(time.time())) + ".png"
filename = config.OUTPUT_FOLDER + str(round(time.time())) + ".png"
for n in il:
for i in range(random.randint(2, 5)):

2
requirements.txt

@ -0,0 +1,2 @@
Pillow==7.0.0
pkg-resources==0.0.0