Browse Source

Kleiner Anfang

master
Eddie 2 years ago
parent
commit
e21109bdde
  1. BIN
      planet1.png
  2. 30
      planets.py
  3. BIN
      planets/light/light0.png
  4. BIN
      planets/light/light1.png
  5. BIN
      planets/light/light10.png
  6. BIN
      planets/light/light2.png
  7. BIN
      planets/light/light3.png
  8. BIN
      planets/light/light4.png
  9. BIN
      planets/light/light5.png
  10. BIN
      planets/light/light6.png
  11. BIN
      planets/light/light7.png
  12. BIN
      planets/light/light8.png
  13. BIN
      planets/light/light9.png
  14. BIN
      planets/noise/noise0.png
  15. BIN
      planets/noise/noise1.png
  16. BIN
      planets/noise/noise10.png
  17. BIN
      planets/noise/noise11.png
  18. BIN
      planets/noise/noise12.png
  19. BIN
      planets/noise/noise13.png
  20. BIN
      planets/noise/noise14.png
  21. BIN
      planets/noise/noise15.png
  22. BIN
      planets/noise/noise16.png
  23. BIN
      planets/noise/noise17.png
  24. BIN
      planets/noise/noise18.png
  25. BIN
      planets/noise/noise19.png
  26. BIN
      planets/noise/noise2.png
  27. BIN
      planets/noise/noise20.png
  28. BIN
      planets/noise/noise21.png
  29. BIN
      planets/noise/noise22.png
  30. BIN
      planets/noise/noise23.png
  31. BIN
      planets/noise/noise24.png
  32. BIN
      planets/noise/noise25.png
  33. BIN
      planets/noise/noise26.png
  34. BIN
      planets/noise/noise27.png
  35. BIN
      planets/noise/noise3.png
  36. BIN
      planets/noise/noise4.png
  37. BIN
      planets/noise/noise5.png
  38. BIN
      planets/noise/noise6.png
  39. BIN
      planets/noise/noise7.png
  40. BIN
      planets/noise/noise8.png
  41. BIN
      planets/noise/noise9.png
  42. BIN
      planets/sphere/sphere0.png
  43. BIN
      planets/sphere/sphere1.png
  44. BIN
      planets/sphere/sphere2.png
  45. 23
      requirements.txt
  46. BIN
      test3.png
  47. BIN
      test4.png

BIN
planet1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 KiB

30
planets.py

@ -0,0 +1,30 @@
import os, random
from PIL import Image
light_directory = os.fsencode(str(os.getcwd() + "/planets/light"))
noise_directory = os.fsencode(str(os.getcwd() + "/planets/noise"))
sphere_directory = os.fsencode(str(os.getcwd() + "/planets/sphere"))
amount_lights = len(os.listdir(light_directory))
amount_noise = len(os.listdir(noise_directory))
amount_sphere = len(os.listdir(sphere_directory))
def blendPlanetParts(light, noise, sphere, alpha):
blended = Image.blend(sphere, light, alpha)
blended2 = Image.blend(blended, noise, alpha)
return blended2
def getRandomPlanet():
light = Image.open("planets/light/light" + str(random.randrange(0,amount_lights)) + ".png").convert('RGBA')
noise = Image.open("planets/noise/noise" + str(random.randrange(0,amount_noise)) + ".png").convert('RGBA')
sphere = Image.open("planets/sphere/sphere" + str(random.randrange(0,amount_sphere)) + ".png").convert('RGBA')
planet = blendPlanetParts(light, noise, sphere, 0.1)
return planet
planet = getRandomPlanet()
planet.save('planet1.png')

BIN
planets/light/light0.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
planets/light/light1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
planets/light/light10.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
planets/light/light2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
planets/light/light3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
planets/light/light4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
planets/light/light5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

BIN
planets/light/light6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
planets/light/light7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
planets/light/light8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
planets/light/light9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
planets/noise/noise0.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

BIN
planets/noise/noise1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

BIN
planets/noise/noise10.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

BIN
planets/noise/noise11.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
planets/noise/noise12.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

BIN
planets/noise/noise13.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

BIN
planets/noise/noise14.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

BIN
planets/noise/noise15.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

BIN
planets/noise/noise16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

BIN
planets/noise/noise17.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

BIN
planets/noise/noise18.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

BIN
planets/noise/noise19.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
planets/noise/noise2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

BIN
planets/noise/noise20.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

BIN
planets/noise/noise21.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

BIN
planets/noise/noise22.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

BIN
planets/noise/noise23.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
planets/noise/noise24.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
planets/noise/noise25.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

BIN
planets/noise/noise26.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

BIN
planets/noise/noise27.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

BIN
planets/noise/noise3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

BIN
planets/noise/noise4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

BIN
planets/noise/noise5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
planets/noise/noise6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
planets/noise/noise7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

BIN
planets/noise/noise8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
planets/noise/noise9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
planets/sphere/sphere0.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

BIN
planets/sphere/sphere1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

BIN
planets/sphere/sphere2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

23
requirements.txt

@ -0,0 +1,23 @@
aniso8601==9.0.1
apispec==6.3.0
click==8.1.3
Flask==2.2.3
flask-apispec==0.11.4
Flask-Cors==3.0.10
flask-marshmallow==0.14.0
Flask-RESTful==0.3.9
Flask-SQLAlchemy==3.0.3
greenlet==2.0.2
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.2
marshmallow==3.19.0
marshmallow-sqlalchemy==0.29.0
packaging==23.0
pytz==2022.7.1
six==1.16.0
SQLAlchemy==2.0.7
termcolor==2.2.0
typing_extensions==4.5.0
webargs==8.2.0
Werkzeug==2.2.3

BIN
test3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

BIN
test4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 KiB

Loading…
Cancel
Save