typemytype / drawbot

http://www.drawbot.com
Other
393 stars 61 forks source link

ImageObject.randomGenerator() yields a constant result #553

Open chrisjansky opened 6 months ago

chrisjansky commented 6 months ago

Hello,

Despite the name random, the randomGenerator() method of ImageObject() yields the same result every time.

Minimal reproduction:

img = ImageObject()
img.randomGenerator((1000, 1000))
image(img, (0,0))

Is there a way to supply a seed parameter or perhaps instruct CoreImage to reinitialise to get a different result on each execution?

Thanks! :—)

typemytype commented 6 months ago

well the image generated is random to infinity only DrawBot cannot draw infinite images so it clips it to the given size, so you see always the same result

see https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIRandomGenerator

chrisjansky commented 6 months ago

@typemytype Thank you Frederik for clarifying. In other words there’s nothing that can be done to randomise the result at all?

What I am asking is if I draw a randomGenerator(size=(10, 10)), perhaps it would output a random (10, 10) crop of the infinite image?