Readme updated with new features
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 267 B |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 407 B |
After Width: | Height: | Size: 3.1 KiB |
|
@ -17,7 +17,7 @@ operations = {
|
|||
"+": lambda x, y: x + y,
|
||||
"-": lambda x, y: x - y,
|
||||
"÷?": lambda x, y: x if y == 0 else x / y, # don't want division by zero errors, and filenames can't have / in them.
|
||||
#"log": lambda x, y: math.log(x, y), # giving math domain errors
|
||||
"log? base": lambda x, y: x if abs(x) <= 1 or abs(y) <= 1 else math.log(abs(x), abs(y)),
|
||||
#"~": lambda x, y: ~(getop()(x, y)), # todo
|
||||
">>": lambda x, y: x >> y,
|
||||
"<<": lambda x, y: x << y,
|
||||
|
@ -106,7 +106,7 @@ for y in range(1024):
|
|||
for x in range(1024):
|
||||
data += bytes([the_function(x, y)])
|
||||
bar.index = y
|
||||
if y % 13 == 0: bar.update()
|
||||
if y % 13 == 0 or greyscale: bar.update()
|
||||
|
||||
|
||||
img.write_raw_idat_data(img.compress(data))
|
||||
|
|
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 630 B After Width: | Height: | Size: 630 B |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 709 B After Width: | Height: | Size: 709 B |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 597 B After Width: | Height: | Size: 597 B |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 287 B |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
14
readme.md
|
@ -1,11 +1,21 @@
|
|||
## Generate images from a random pattern
|
||||
|
||||
Taken from someone elses' idea on fractialforums and expanded
|
||||
Someone on fractalforums gave me the idea of creating random images based on mathematical operations
|
||||
|
||||
This generates a random set of operators and a random set of operands, either x, y or a random number, and composes them into a formula.
|
||||
|
||||
It then generates an image using the lowest order bit of the result of that formula for each pixel.
|
||||
|
||||
For example, if it generated the formula (((x ^ y) - y) \* x) >> 11, then the output would look like this
|
||||
For example, if it generated the formula ((((x ^ y) - y) \* x) >> 11) & 1, then the output would look like this
|
||||
|
||||

|
||||
|
||||
### Dependencies
|
||||
|
||||
Depends on [libpme](https://github.com/nilesr/libpme) (`pip3 install libpme`)
|
||||
|
||||
### Usage
|
||||
|
||||
python3 generator.py [mode]
|
||||
|
||||
`mode` can be one of `high` or `greyscale`. If left blank, it generates an image using the lowest bit of the result of the formula. If set to high, it will use the highest bit of the result. If set to greyscale, it will use the result of the formula as a shade of grey, truncated to one byte for png.
|
||||
|
|