2013-01-09 04:07:11 +01:00
|
|
|
import mapnik
|
|
|
|
import random
|
|
|
|
|
|
|
|
im = mapnik.Image(256,256)
|
|
|
|
|
2019-12-31 12:39:57 +01:00
|
|
|
for x in range(im.width()):
|
|
|
|
for y in range(im.height()):
|
2013-01-09 04:07:11 +01:00
|
|
|
r = int(random.random() * 255)
|
|
|
|
g = random.random() * 255
|
|
|
|
b = random.random() * 255
|
|
|
|
a = random.random()
|
|
|
|
color = mapnik.Color('rgba(%i,%i,%i,%f)' % (r,g,b,a))
|
|
|
|
im.set_pixel(x,y,color)
|
|
|
|
|
|
|
|
im.save('./benchmark/data/multicolor.png')
|