Exemplo n.º 1
0
import os
import random

from imagecrosser import ImageCrosser
from patternedimage import PatternedImage
from shared import shared

if __name__ == '__main__':
    dims = (1080, 1080)
    dpis = [2880 // i for i in [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16]]
    print(dpis)
    # img = PatternedImage.new(PatternedImage.diamonds, dims=dims, colours=[(209, 123, 193), (123, 193, 209), (12, 19, 29)])
    # img = PatternedImage.new(PatternedImage.stripedMulti, dims=dims, colours=shared.randomRGBContrasting(5))
    # img = PatternedImage.new(PatternedImage.diamonds, dims=dims, colours=shared.randomRGBPair())

    currentGen = [PatternedImage.new(dims=dims) for i in range(10)]

    now = datetime.datetime.now()
    folder = now.strftime("generations\%Y%m%d_%H%M%S")
    os.mkdir(folder)

    for genID in range(12):
        print("\nWriting generation {}: ".format(genID), end='')
        count = 0
        for img in currentGen:
            print("{}, ".format(count), end='')

            # img.save("{}\gen{}_{}.jpg".format(folder, genID, count))
            img.save("{}\gen{}_{}.png".format(folder, genID, count))
            count += 1
Exemplo n.º 2
0
"""
Experiment to use Pillow to create Gaussians and help populate the stored distributions
"""

from patternedimage import PatternedImage
from shared import shared

if __name__ == '__main__':
    dims = (1080, 1080)
    img = PatternedImage.new(PatternedImage.gaussian, dims=dims, colours=[(0, 0, 0), (255, 255, 255), (0, 0, 0)]) # shared.randomRGBContrasting(2)) #  [(209, 123, 193), (123, 193, 209)])
    img.show()