diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..f7c0dae Binary files /dev/null and b/.DS_Store differ diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..3f72c60 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +random-art \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..edecc55 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..77e9ae2 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/random-art.iml b/.idea/random-art.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/random-art.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..2c8bff8 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,556 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1433789315213 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 8f6abaf..36148e5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Random Art - + ## Description Create art using Python's random module and math functions. diff --git a/__pycache__/random_art.cpython-34.pyc b/__pycache__/random_art.cpython-34.pyc new file mode 100644 index 0000000..97cdeff Binary files /dev/null and b/__pycache__/random_art.cpython-34.pyc differ diff --git a/create_art.py b/create_art.py index ba3cb55..9b8f280 100644 --- a/create_art.py +++ b/create_art.py @@ -55,8 +55,8 @@ def make_gray(seed, num_pics=1, width=300): gray_exp = create_expression() print("{}: {}".format(filename, gray_exp)) image = generate_monochrome_image(gray_exp, width) - image.save(filename, "PNG") - + #image.save(filename, "PNG") + image.show() def make_color(seed, num_pics=1, width=300): """Creates n color image files named color0.png, color1.png, ...""" @@ -71,8 +71,8 @@ def make_color(seed, num_pics=1, width=300): green_exp, blue_exp)) image = generate_rgb_image(red_exp, green_exp, blue_exp, width) - image.save(filename, "PNG") - + #image.save(filename, "PNG") + image.show() if __name__ == '__main__': parser = argparse.ArgumentParser(description='Create random art.') diff --git a/random_art.py b/random_art.py index b13271b..998b887 100644 --- a/random_art.py +++ b/random_art.py @@ -1,4 +1,5 @@ import random +import os # Your job is to create better version of create_expression and # run_expression to create random art. @@ -8,7 +9,10 @@ def create_expression(): """This function takes no arguments and returns an expression that generates a number between -1.0 and 1.0, given x and y coordinates.""" - expr = lambda x, y: (random.random() * 2) - 1 + + # After about 100 different attempts, this created the best image. + z = random.random()/random.random()**4 + expr = lambda x, y: (x*y/z) return expr diff --git a/the_80s_called.bmp b/the_80s_called.bmp new file mode 100644 index 0000000..825cf29 Binary files /dev/null and b/the_80s_called.bmp differ diff --git a/the_best_one.bmp b/the_best_one.bmp new file mode 100644 index 0000000..a31c541 Binary files /dev/null and b/the_best_one.bmp differ diff --git a/tmp1gkuq3vb.bmp b/tmp1gkuq3vb.bmp new file mode 100644 index 0000000..8b3110b Binary files /dev/null and b/tmp1gkuq3vb.bmp differ diff --git a/tmp4t39irde.bmp b/tmp4t39irde.bmp new file mode 100644 index 0000000..b292bb1 Binary files /dev/null and b/tmp4t39irde.bmp differ diff --git a/tmp774mbcas.bmp b/tmp774mbcas.bmp new file mode 100644 index 0000000..cd8ad9b Binary files /dev/null and b/tmp774mbcas.bmp differ diff --git a/tmpfr_3b1w2.bmp b/tmpfr_3b1w2.bmp new file mode 100644 index 0000000..dac15d6 Binary files /dev/null and b/tmpfr_3b1w2.bmp differ diff --git a/tmpg0jlblpy.bmp b/tmpg0jlblpy.bmp new file mode 100644 index 0000000..f656173 Binary files /dev/null and b/tmpg0jlblpy.bmp differ diff --git a/tmpkqvvb092.bmp b/tmpkqvvb092.bmp new file mode 100644 index 0000000..f7546dc Binary files /dev/null and b/tmpkqvvb092.bmp differ diff --git a/tmpo_95sstp.bmp b/tmpo_95sstp.bmp new file mode 100644 index 0000000..ebaf8e5 Binary files /dev/null and b/tmpo_95sstp.bmp differ diff --git a/tmppd5e3omz.bmp b/tmppd5e3omz.bmp new file mode 100644 index 0000000..e749504 Binary files /dev/null and b/tmppd5e3omz.bmp differ diff --git a/tmpqq44nfdc.bmp b/tmpqq44nfdc.bmp new file mode 100644 index 0000000..11851b1 Binary files /dev/null and b/tmpqq44nfdc.bmp differ diff --git a/tmpur8fyzzs.bmp b/tmpur8fyzzs.bmp new file mode 100644 index 0000000..7454f6c Binary files /dev/null and b/tmpur8fyzzs.bmp differ diff --git a/tmpwofpuf7g.bmp b/tmpwofpuf7g.bmp new file mode 100644 index 0000000..05aadff Binary files /dev/null and b/tmpwofpuf7g.bmp differ diff --git a/tmpwos7x43r.bmp b/tmpwos7x43r.bmp new file mode 100644 index 0000000..f3a5f5c Binary files /dev/null and b/tmpwos7x43r.bmp differ