예제 #1
0
num_y = random.randint(2,4)


x_points = [random.randint(0,canvas.width) for i in range(num_x)]
y_points = [random.randint(0,canvas.height) for i in range(num_y)]

x_points.append(-10)
x_points.append(canvas.width+10)
y_points.append(-10)
y_points.append(canvas.height+10)

for x in x_points:
    for y in y_points:
        # first find the nearest x point, and use to decide width
        try:
            canvas.line((0,y),(canvas.width,y), ink=sketcher.Ink(color=(40,40,40),weight=4))
            next_x = [p for p in x_points if x < p]
            next_x.sort()
            next_x = next_x[0]
            next_y = [p for p in y_points if y < p]
            next_y.sort()
            next_y = next_y[0]
            width = next_x - x
            height = next_y - y
            if random.randint(0,3) == 0:
                color = random.choice(colors)
            else:
                color = (240,240,240)
            canvas.rect((x,y),width,height,sketcher.Ink(color=color))
        except:
            pass
예제 #2
0
import sketcher
import random

canvas = sketcher.Canvas(800, 800)
ink = sketcher.Ink(color=(100, 100, 100),
                   warp_seeds=[random.randint(0, 999) for i in [1, 2]],
                   warp_scale=0.01,
                   warp_size=0)

canvas.fill(sketcher.Ink('simplex_gradient', color=(60, 60, 60)))

y = 300

while y < canvas.height - 200:

    canvas.circle((canvas.width / 2, y), 300, 299, ink)
    ink.warp_size += 4
    y += 7

canvas.show()
canvas.save('cool' + str(random.randint(0, 99999999)) + '.png')
예제 #3
0
import sketcher
import random
from opensimplex import OpenSimplex
canvas = sketcher.Canvas(1000, 1000)

ink = sketcher.Ink('simplex_gradient', (200, 200, 200),
                   c_var=70,
                   noise_seeds=[random.randint(0, 999) for i in range(3)],
                   warp_scale=0.004,
                   warp_size=300)

for i in range(3):
    ink.warp_noise = [OpenSimplex(random.randint(0, 999)) for i in range(2)]
    for y in range(0 - ink.warp_size, canvas.height + ink.warp_size, 10):
        canvas.line((0 - ink.warp_size, y), (canvas.width + ink.warp_size, y),
                    ink)

canvas.save('overlapping_grids_{}.png'.format(random.randint(1, 9999)))
canvas.show()
예제 #4
0
          (244, 238, 224), (200, 38, 49)]

num_x = random.randint(2, 15)
num_y = random.randint(2, 15)

x_points = [random.randint(0, canvas.width / 20) * 20 for i in range(num_x)]
y_points = [random.randint(0, canvas.height / 20) * 20 for i in range(num_y)]

noise_seeds = [random.randint(0, 999) for i in range(3)]

for x in x_points:
    last_y = 0
    while last_y <= canvas.height:
        next_y = last_y + (random.randint(1, 5) * 20)
        color = random.choice(colors)
        line_tone = sketcher.Ink(color=color, weight=20)
        canvas.line((x, last_y), (x, next_y), ink=line_tone)
        last_y = next_y

for y in y_points:
    last_x = 0
    while last_x <= canvas.height:
        next_x = last_x + (random.randint(1, 5) * 20)
        color = random.choice(colors)
        line_tone = sketcher.Ink(color=color, weight=20)
        canvas.line((last_x, y), (next_x, y), ink=line_tone)
        last_x = next_x

for x in x_points:
    for y in y_points:
        color = random.choice(colors)
예제 #5
0
import sketcher

canvas = sketcher.Canvas(700, 700)
spacing = 12

canvas.fill(sketcher.Ink(color=(100, 100, 100)))

for i in range(spacing, int(canvas.width), spacing):
    canvas.circle((canvas.width / 2, canvas.height / 2), i, i - 1,
                  sketcher.Ink(warp_scale=0.008, warp_size=i * 0.4))

canvas.show()
예제 #6
0
import sketcher
import random

canvas = sketcher.Canvas(700, 700)

toner = sketcher.Ink(color=(240, 240, 240))

seeds = [random.randint(0, 999), random.randint(0, 999)]
scale = 0.002
size = random.randint(40, 150)

background = sketcher.Ink(
    'simplex_gradient', (33, 136, 254),
    c_var=70,
    noise_scale=0.002,
    noise_seeds=[random.randint(0, 999) for x in range(3)])

canvas.fill(background)

x = -size

while x < canvas.width + size:
    y = -size
    while y < canvas.height + size:
        canvas.circle(sketcher.adjust_point((x, y), seeds, scale, size),
                      3,
                      ink=toner)
        y += 20
    x += 20

canvas.show()
예제 #7
0
import sketcher
import random

canvas = sketcher.Canvas(800, 800)
ink = sketcher.Ink('simplex_gradient',
                   color=(200, 200, 200),
                   c_var=70,
                   noise_seeds=[random.randint(0, 9999) for i in range(3)],
                   warp_seeds=[random.randint(0, 999) for i in [1, 2]],
                   warp_scale=0.01,
                   warp_size=50)

#canvas.fill(sketcher.Ink('simplex_gradient', color=(60,60,60)))

for i in range(1):
    x_offset = random.uniform(-1, 1) * 200
    y_offset = random.uniform(-1, 1) * 200

    size = 5
    while size < canvas.height:
        canvas.circle(
            (canvas.width / 2 + x_offset, canvas.height / 2 + y_offset), size,
            size - 2, ink)
        size += 5

canvas.show()
canvas.save('circles{}.png'.format(random.randint(1, 999999)))
예제 #8
0
import sketcher
import opensimplex
import random

canvas = sketcher.Canvas(600,600)
noise_scale = 0.004

for c in [(137,143,167),(224,173,89),(209,192,181)]:
    noise = opensimplex.OpenSimplex(random.randint(0,9999))
    ink = sketcher.Ink(color=c)
    for x in range(canvas.width):
        for y in range(canvas.width):
            ink.transparency = sketcher.mapped_noise(noise, (x*noise_scale, y*noise_scale), 0.4, 1)
            ink.point(canvas, (x,y))

canvas.save('grad{}.png'.format(random.randint(0,9999)))
canvas.show()
예제 #9
0
import sketcher
import math
import random

canvas = sketcher.Canvas(800,800)

def x(t):
    return math.sin(t/12) * 220 + math.sin(t/15) * 100

def y(t):
    return math.cos(t / 10) * 130 + math.cos(t / 13) * 200

start = random.randint(0,9999999)

canvas.fill(sketcher.Ink('simplex_gradient', color=(200,200,200)))
ink = sketcher.Ink(color=(200,200,200))

for i in range(3000):
    t = start + i
    canvas.rect((canvas.width/2+x(t/15),canvas.height/2+y(t/15)), 2, 2, ink)

canvas.show()