kopia lustrzana https://github.com/sepandhaghighi/samila
Minor edits (#86)
* update : 3.png updated. * update : pictures updated. * revert : images reverted. * update : README.md updated. * update : README.md updated.pull/106/head
rodzic
6433357081
commit
c802a4088a
|
@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||||
- `function1_str` attribute
|
- `function1_str` attribute
|
||||||
- `function2_str` attribute
|
- `function2_str` attribute
|
||||||
### Changed
|
### Changed
|
||||||
|
- `README.md` updated
|
||||||
- `plot` section added to data file
|
- `plot` section added to data file
|
||||||
- `edgecolor` changed to `c` in `plot` method
|
- `edgecolor` changed to `c` in `plot` method
|
||||||
- `config` parameter added to GenerativeImage `__init__`
|
- `config` parameter added to GenerativeImage `__init__`
|
||||||
|
|
28
README.md
28
README.md
|
@ -114,13 +114,13 @@ Samila is a generative art generator written in Python, Samila let's you create
|
||||||
```pycon
|
```pycon
|
||||||
>>> import random
|
>>> import random
|
||||||
>>> import math
|
>>> import math
|
||||||
>>> def f1(x,y):
|
>>> def f1(x, y):
|
||||||
result = random.uniform(-1,1) * x**2 - math.sin(y**2) + abs(y-x)
|
result = random.uniform(-1,1) * x**2 - math.sin(y**2) + abs(y-x)
|
||||||
return result
|
return result
|
||||||
>>> def f2(x,y):
|
>>> def f2(x, y):
|
||||||
result = random.uniform(-1,1) * y**3 - math.cos(x**2) + 2*x
|
result = random.uniform(-1,1) * y**3 - math.cos(x**2) + 2*x
|
||||||
return result
|
return result
|
||||||
>>> g = GenerativeImage(f1,f2)
|
>>> g = GenerativeImage(f1, f2)
|
||||||
>>> g.generate()
|
>>> g.generate()
|
||||||
>>> g.plot()
|
>>> g.plot()
|
||||||
>>> g.seed
|
>>> g.seed
|
||||||
|
@ -132,7 +132,7 @@ Samila is a generative art generator written in Python, Samila let's you create
|
||||||
### Projection
|
### Projection
|
||||||
```pycon
|
```pycon
|
||||||
>>> from samila import Projection
|
>>> from samila import Projection
|
||||||
>>> g = GenerativeImage(f1,f2)
|
>>> g = GenerativeImage(f1, f2)
|
||||||
>>> g.generate()
|
>>> g.generate()
|
||||||
>>> g.plot(projection=Projection.POLAR)
|
>>> g.plot(projection=Projection.POLAR)
|
||||||
>>> g.seed
|
>>> g.seed
|
||||||
|
@ -146,8 +146,8 @@ Samila is a generative art generator written in Python, Samila let's you create
|
||||||
|
|
||||||
### Range
|
### Range
|
||||||
```pycon
|
```pycon
|
||||||
>>> g = GenerativeImage(f1,f2)
|
>>> g = GenerativeImage(f1, f2)
|
||||||
>>> g.generate(start = -2*math.pi,step=0.1,stop=0)
|
>>> g.generate(start=-2*math.pi, step=0.01, stop=0)
|
||||||
>>> g.plot()
|
>>> g.plot()
|
||||||
>>> g.seed
|
>>> g.seed
|
||||||
234752
|
234752
|
||||||
|
@ -157,9 +157,9 @@ Samila is a generative art generator written in Python, Samila let's you create
|
||||||
|
|
||||||
### Color
|
### Color
|
||||||
```pycon
|
```pycon
|
||||||
>>> g = GenerativeImage(f1,f2)
|
>>> g = GenerativeImage(f1, f2)
|
||||||
>>> g.generate()
|
>>> g.generate()
|
||||||
>>> g.plot(color="yellow",bgcolor="black",projection=Projection.POLAR)
|
>>> g.plot(color="yellow", bgcolor="black", projection=Projection.POLAR)
|
||||||
>>> g.seed
|
>>> g.seed
|
||||||
1018273
|
1018273
|
||||||
>>> plt.show()
|
>>> plt.show()
|
||||||
|
@ -171,7 +171,7 @@ Samila is a generative art generator written in Python, Samila let's you create
|
||||||
|
|
||||||
### Regeneration
|
### Regeneration
|
||||||
```pycon
|
```pycon
|
||||||
>>> g = GenerativeImage(f1,f2)
|
>>> g = GenerativeImage(f1, f2)
|
||||||
>>> g.generate(seed=1018273)
|
>>> g.generate(seed=1018273)
|
||||||
>>> g.plot(projection=Projection.POLAR)
|
>>> g.plot(projection=Projection.POLAR)
|
||||||
>>> plt.show()
|
>>> plt.show()
|
||||||
|
@ -182,7 +182,7 @@ Samila is a generative art generator written in Python, Samila let's you create
|
||||||
Upload generated image directly to [NFT.storage](https://NFT.storage)
|
Upload generated image directly to [NFT.storage](https://NFT.storage)
|
||||||
|
|
||||||
```pycon
|
```pycon
|
||||||
>>> g.nft_storage(api_key = YOUR_API_KEY)
|
>>> g.nft_storage(api_key=YOUR_API_KEY)
|
||||||
{'status': True, 'message': 'Everything seems good'}
|
{'status': True, 'message': 'Everything seems good'}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -237,10 +237,10 @@ We have set of points in the first space (left square) which can be define as fo
|
||||||
And bellow functions are used for transformation:
|
And bellow functions are used for transformation:
|
||||||
|
|
||||||
```pycon
|
```pycon
|
||||||
>>> def f1(x,y):
|
>>> def f1(x, y):
|
||||||
result = random.uniform(-1,1) * x**2 - math.sin(y**2) + abs(y-x)
|
result = random.uniform(-1,1) * x**2 - math.sin(y**2) + abs(y-x)
|
||||||
return result
|
return result
|
||||||
>>> def f2(x,y):
|
>>> def f2(x, y):
|
||||||
result = random.uniform(-1,1) * y**3 - math.cos(x**2) + 2*x
|
result = random.uniform(-1,1) * y**3 - math.cos(x**2) + 2*x
|
||||||
return result
|
return result
|
||||||
```
|
```
|
||||||
|
@ -250,7 +250,7 @@ And bellow functions are used for transformation:
|
||||||
here we uses `Projection.POLAR` so later space will be the polar space and we have:
|
here we uses `Projection.POLAR` so later space will be the polar space and we have:
|
||||||
|
|
||||||
```pycon
|
```pycon
|
||||||
>>> g = GenerativeImage(f1,f2)
|
>>> g = GenerativeImage(f1, f2)
|
||||||
>>> g.generate(seed=10)
|
>>> g.generate(seed=10)
|
||||||
>>> g.plot(projection=Projection.POLAR)
|
>>> g.plot(projection=Projection.POLAR)
|
||||||
```
|
```
|
||||||
|
|
Plik binarny nie jest wyświetlany.
Przed Szerokość: | Wysokość: | Rozmiar: 302 KiB Po Szerokość: | Wysokość: | Rozmiar: 251 KiB |
Ładowanie…
Reference in New Issue