veryjerry3 avatar

My work on python randomized image creation

veryjerry3

Published: 08 Apr 2022 › Updated: 08 Apr 2022My work on python randomized image creation

My work on python randomized image creation

So this is kind of a deviation from what I have worked on before, but hopefully, this will turn help with a blockchain-like project. I have been working on a randomized iterative image creation where nobody knows exactly what it will look like before it's created. In order to make this happen, I used a python library called pillow that uses another very old library called PIL. For this experiment, I wanted to create a square with a random color which I did by randomizing RGB values. With those values and a function called Image.new,I created a 100 by 100 pixel image with a random color. After that, I created a 200 by 200 pixel image with a different random color. I then pasted the first image onto the second image with a random x and y coordinate where the x and y is the position of the top-left of the first image with respect to the second. I then saved the combined image as the second image. I then did the process again with an image twice that length and width and again. At the end of the code I had an image of 4 randomly colored and randomly pasted squares iterated on top of each other

image.png

Here are some examples of various pictures.

randimage4.png

randimage4.png

randimage4.png

I think this modern art is pretty cool!

Leave My work on python randomized image creation to:

Written by

Read more #gradnium posts


Best Posts From veryjerry3

We have not curated any of veryjerry3's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From veryjerry3