All Projects → sepandhaghighi → samila

sepandhaghighi / samila

Licence: MIT license
Generative Art Generator

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to samila

glitch-image
🖼 Generate and save unique glitchy images
Stars: ✭ 46 (-93.87%)
Mutual labels:  art, generative-art, generative
wordpress-nft-plugin
NFT Auction Product Type WordPress Plugin for WooCommerce – BID HAUS
Stars: ✭ 197 (-73.73%)
Mutual labels:  nft, nfts, nft-gallery
book-mdpc
Il cinema tra le righe... di codice!
Stars: ✭ 59 (-92.13%)
Mutual labels:  art, generative-art, generative
Generative-Art
A selection of generative art scripts written in Python
Stars: ✭ 284 (-62.13%)
Mutual labels:  art, generative-art, generative
Snek
See https://github.com/inconvergent/weir instead
Stars: ✭ 696 (-7.2%)
Mutual labels:  art, generative-art, generative
Pts
A library for visualization and creative-coding
Stars: ✭ 4,628 (+517.07%)
Mutual labels:  art, generative-art, generative
corruption-loops
Digitally disintegrating music
Stars: ✭ 37 (-95.07%)
Mutual labels:  art, generative-art, generative
Weir
A system for making generative systems
Stars: ✭ 451 (-39.87%)
Mutual labels:  art, generative-art, generative
Sofloo Spot
Click Randomize
Stars: ✭ 37 (-95.07%)
Mutual labels:  art, generative-art, generative
nft-collection-generator
Generates images and metadata for a collection of NFTs.
Stars: ✭ 77 (-89.73%)
Mutual labels:  generative-art, nft, nfts
elm-generative
Making generative art in Elm
Stars: ✭ 23 (-96.93%)
Mutual labels:  art, generative
nft-gallery
NFT Explorer 🗺 🧭 running on Kusama and Polkadot
Stars: ✭ 281 (-62.53%)
Mutual labels:  nft, nft-gallery
glitch-art-bot-ts
Twitter bot that glitches photos on the fly
Stars: ✭ 66 (-91.2%)
Mutual labels:  art, generative-art
generative.fm
A platform for playing generative music in the browser.
Stars: ✭ 1,557 (+107.6%)
Mutual labels:  art, generative-art
nftool
A suite of tools for NFT generative art.
Stars: ✭ 145 (-80.67%)
Mutual labels:  generative-art, nft
GAS
Generative Art Synthesizer - a python program that generates python programs that generates generative art
Stars: ✭ 42 (-94.4%)
Mutual labels:  generative-art, generative
NFT.net
An engine developed with .NET Core to generate NFT's through a graphical interface. Simple as that, in the best Grab & Go style.
Stars: ✭ 294 (-60.8%)
Mutual labels:  art, nft
enjin-cpp-sdk
Enjin Platform SDK for C++.
Stars: ✭ 15 (-98%)
Mutual labels:  nft, nfts
GenerativeArtists
No description or website provided.
Stars: ✭ 22 (-97.07%)
Mutual labels:  generative-art, generative
opensea automatic uploader
(Bypass reCAPTCHAs) A Selenium Python bot to automatically and bulky upload and list your NFTs on OpenSea (all metadata integrated - Ethereum and Polygon supported); reCAPTCHA solver & bypasser included.
Stars: ✭ 205 (-72.67%)
Mutual labels:  nft, nfts

Samila


built with Python3 PyPI version Samila-Colab Discord Channel

Table of contents

Overview

Samila is a generative art generator written in Python, Samila let's you create arts based on many thousand points. The position of every single point is calculated by a formula, which has random parameters. Because of the random numbers, every image looks different.

Open Hub
PyPI Counter
Github Stars
Branch master dev
CI
Code Quality codebeat badge CodeFactor

Installation

Source code

  • Download Version 0.8 or Latest Source
  • Run pip install -r requirements.txt or pip3 install -r requirements.txt (Need root access)
  • Run python3 setup.py install or python setup.py install (Need root access)

PyPI

Easy install

  • Run easy_install --upgrade samila (Need root access)

Usage

Magic

>>> import matplotlib.pyplot as plt
>>> from samila import GenerativeImage
>>> g = GenerativeImage()
>>> g.generate()
>>> g.plot()
>>> plt.show()

Basic

>>> import random
>>> import math
>>> def f1(x, y):
    result = random.uniform(-1,1) * x**2  - math.sin(y**2) + abs(y-x)
    return result
>>> def f2(x, y):
    result = random.uniform(-1,1) * y**3 - math.cos(x**2) + 2*x
    return result
>>> g = GenerativeImage(f1, f2)
>>> g.generate()
>>> g.plot()
>>> g.seed
188781
>>> plt.show()

Projection

>>> from samila import Projection
>>> g = GenerativeImage(f1, f2)
>>> g.generate()
>>> g.plot(projection=Projection.POLAR)
>>> g.seed
829730
>>> plt.show()

  • Supported projections : RECTILINEAR, POLAR, AITOFF, HAMMER, LAMBERT, MOLLWEIDE and RANDOM
  • Default projection is RECTILINEAR

Range

>>> g = GenerativeImage(f1, f2)
>>> g.generate(start=-2*math.pi, step=0.01, stop=0)
>>> g.plot()
>>> g.seed
234752
>>> plt.show()

Color

>>> g = GenerativeImage(f1, f2)
>>> g.generate()
>>> g.plot(color="yellow", bgcolor="black", projection=Projection.POLAR)
>>> g.seed
1018273
>>> plt.show()

  • Supported colors are available in VALID_COLORS list

  • color and bgcolor parameters supported formats:

    1. Color name (example: color="yellow")
    2. RGB/RGBA (example: color=(0.1,0.1,0.1), color=(0.1,0.1,0.1,0.1))
    3. Hex (example: color="#eeefff")
    4. Random (example: color="random")
    5. Complement (example: color="complement", bgcolor="blue")
    6. Transparent (example: bgcolor="transparent")

⚠️ Transparent mode is only available for background

Regeneration

>>> g = GenerativeImage(f1, f2)
>>> g.generate(seed=1018273)
>>> g.plot(projection=Projection.POLAR)
>>> plt.show()

NFT.storage

Upload generated image directly to NFT.storage

>>> g.nft_storage(api_key="YOUR_API_KEY")
{'status': True, 'message': 'FILE_LINK'}

Save image

Save generated image

>>> g.save_image(file_adr="test.png")
{'status': True, 'message': 'FILE_PATH'}

Save generated image in higher resolutions

>>> g.save_image(file_adr="test.png", depth=5)
{'status': True, 'message': 'FILE_PATH'}

Save data

Save generated image data

>>> g.save_data(file_adr="data.json")
{'status': True, 'message': 'FILE_PATH'}

So you can load it into a GenerativeImage instance later by

>>> g = GenerativeImage(data=open('data.json', 'r'))

Data structure:

{
  "plot": {
    "projection": "polar",
    "bgcolor": "black",
    "color": "snow",
    "spot_size": 0.01
  },
  "matplotlib_version": "3.0.3",
  "data1": [
    0.3886741692042526,
    22.57390286376703,
    -0.1646310981668766,
    66.23632344600155
  ],
  "data2": [
    -0.14588750183600108,
    20.197945942677833,
    0.5485453260942901,
    -589.3284610518896
  ]
}

Save config

Save generated image config. It contains string formats of functions which is also human readable.

>>> g.save_config(file_adr="config.json")
{'status': True, 'message': 'FILE_PATH'}

So you can load it into a GenerativeImage instance later by

>>> g = GenerativeImage(config=open('config.json', 'r'))

Config structure:

{
    "matplotlib_version": "3.0.3",
    "generate": {
        "seed": 379184,
        "stop": 3.141592653589793,
        "step": 0.01,
        "start": -3.141592653589793
    },
    "f2": "random.uniform(-1,1)*math.cos(x*(y**3))+random.uniform(-1,1)*math.ceil(y-x)",
    "f1": "random.uniform(-1,1)*math.ceil(y)-random.uniform(-1,1)*y**2+random.uniform(-1,1)*abs(y-x)",
    "plot": {
        "color": "snow",
        "bgcolor": "black",
        "projection": "polar",
        "spot_size": 0.01
    }
}

Mathematical details

Samila is simply a transformation between a square-shaped space from the Cartesian coordinate system to any arbitrary coordination like Polar coordinate system.

Example

We have set of points in the first space (left square) which can be define as follow:

And bellow functions are used for transformation:

>>> def f1(x, y):
    result = random.uniform(-1,1) * x**2 - math.sin(y**2) + abs(y-x)
    return result
>>> def f2(x, y):
    result = random.uniform(-1,1) * y**3 - math.cos(x**2) + 2*x
    return result

here we uses Projection.POLAR so later space will be the polar space and we have:

>>> g = GenerativeImage(f1, f2)
>>> g.generate(seed=10)
>>> g.plot(projection=Projection.POLAR)

Try Samila in your browser!

Samila can be used online in interactive Jupyter Notebooks via the Binder or Colab services! Try it out now! :

Binder

Google Colab

  • Check examples folder

Issues & bug reports

Just fill an issue and describe it. We'll check it ASAP!

  • Please complete the issue template

You can also join our discord server

Discord Channel

Dependencies

master dev
Requirements Status Requirements Status

Social media

  1. Instagram
  2. Telegram
  3. Twitter
  4. Discord

References

1- Schönlieb, Carola-Bibiane, and Franz Schubert. "Random simulations for generative art construction–some examples." Journal of Mathematics and the Arts 7.1 (2013): 29-39.
2- Create Generative Art with R
3- NFT.storage : Free decentralized storage and bandwidth for NFTs

Acknowledgments

This project was funded through the Next Step Microgrant, a program established by Protocol Labs.

Show your support

Star this repo

Give a ⭐️ if this project helped you!

Donate to our project

If you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .

Bitcoin

1KtNLEEeUbTEK9PdN6Ya3ZAKXaqoKUuxCy

Ethereum

0xcD4Db18B6664A9662123D4307B074aE968535388

Litecoin

Ldnz5gMcEeV8BAdsyf8FstWDC6uyYR6pgZ

Doge

DDUnKpFQbBqLpFVZ9DfuVysBdr249HxVDh

Tron

TCZxzPZLcJHr2qR3uPUB1tXB6L3FDSSAx7

Ripple

rN7ZuRG7HDGHR5nof8nu5LrsbmSB61V1qq

Binance Coin

bnb1zglwcf0ac3d0s2f6ck5kgwvcru4tlctt4p5qef

Tether

0xcD4Db18B6664A9662123D4307B074aE968535388

Dash

Xd3Yn2qZJ7VE8nbKw2fS98aLxR5M6WUU3s

Stellar

GALPOLPISRHIYHLQER2TLJRGUSZH52RYDK6C3HIU4PSMNAV65Q36EGNL

Zilliqa

zil1knmz8zj88cf0exr2ry7nav9elehxfcgqu3c5e5

Coffeete

Gitcoin

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].