Samila is a generative art generator written in Python

Overview

Samila



built with Python3 PyPI version

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

Installation

Source code

  • Download Version 0.1 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

Basic

>>> import random
>>> import math
>>> import matplotlib.pyplot as plt
>>> from samila import GenerativeImage
>>> 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 and MOLLWEIDE
  • Default projection is RECTILINEAR

Range

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

Color

>> g.seed 1018273 >>> plt.show() ">
>>> 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 support color name and RGB/RGBA formats

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': 'Everything seems good'}

Issues & bug reports

Just fill an issue and describe it. We'll check it ASAP! or send an email to [email protected].

  • Please complete the issue template

Dependencies

master dev
Requirements Status Requirements Status

References

1-

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

Comments
  • Test System Structure

    Test System Structure

    Reference Issues/PRs

    #42

    What does this implement/fix? Explain your changes.

    Added

    • samila_help function
    • test.py
    • function_test.py
    • isSimilarData function

    Changed

    • __main__.py updated
    • test.yml updated

    Any other comments?

    Tests are supporting bellow OSs:

    [ubuntu-latest, windows-latest, macOS-latest]
    

    and python versions (macOS has an exception on 3.5):

    [3.5, 3.6, 3.7, 3.8, 3.9]
    
    enhancement 
    opened by sadrasabouri 4
  • Data/Config Upload to IPFS

    Data/Config Upload to IPFS

    Reference Issues/PRs

    #145 and #144

    What does this implement/fix? Explain your changes.

    Added
    • get_data function
    • get_config function
    Changed
    • upload_data parameter added to nft_storage method
    • upload_config parameter added to nft_storage method

    Any other comments?

    new feature 
    opened by sadrasabouri 3
  • Add linewidth parameter to plot method

    Add linewidth parameter to plot method

    Description

    It seems that this parameter has a significant effect on the output

    Linewidth: 1.2 | Spot Size: 0.1

    l12_s01

    Linewidth: 1.2 | Spot Size: 10

    112_s10

    Linewidth: 12 | Spot Size: 0.1

    l120_s01

    Linewidth: 12 | Spot Size: 10

    1120_s10

    enhancement new feature 
    opened by sepandhaghighi 3
  • Data Save and Load Structure

    Data Save and Load Structure

    Reference Issues/PRs

    #33

    What does this implement/fix? Explain your changes.

    • load_data function
    • save_data_file function
    • save_data method
    • and minor error, warning handling
    enhancement 
    opened by sadrasabouri 3
  • add resolution change

    add resolution change

    Reference Issues/PRs

    Added

    • depth parameter added to save_image method
    • depth parameter added to save_fig_file function

    What does this implement/fix? Explain your changes.

    Any other comments?

    opened by mhmoslemi2338 3
  • Version 1.0

    Version 1.0

    Reference Issues/PRs

    close #155 close #123 close #144 close #145 close #156

    What does this implement/fix? Explain your changes.

    Version 1.0

    Any other comments?

    release 
    opened by sepandhaghighi 2
  • Bump art from 5.7 to 5.8

    Bump art from 5.7 to 5.8

    Bumps art from 5.7 to 5.8.

    Release notes

    Sourced from art's releases.

    Version 5.8

    • 8 new font added #207 #208 1- russian2 2- got 3- vip 4- crazy 5- cruse 6- drippy 7- stylish 8- ayda
    • Test system modified
    • Python 3.11 added to test.yml
    • Conda-Forge installing section added to INSTALL.md
    • Website changed to https://www.ascii-art.site
    • testcov and testcov2 modes removed
    Changelog

    Sourced from art's changelog.

    [5.8] - 2022-11-23

    Added

    • 8 new font
      1. russian2
      2. got
      3. vip
      4. crazy
      5. cruse
      6. drippy
      7. stylish
      8. ayda

    Changed

    • Test system modified
    • Python 3.11 added to test.yml
    • Conda-Forge installing section added to INSTALL.md
    • Website changed to https://www.ascii-art.site

    Removed

    • testcov and testcov2 modes
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • Bump matplotlib from 3.5.2 to 3.5.3

    Bump matplotlib from 3.5.2 to 3.5.3

    Bumps matplotlib from 3.5.2 to 3.5.3.

    Release notes

    Sourced from matplotlib's releases.

    REL: v3.5.3

    This is the third bugfix release of the 3.5.x series.

    This release contains several bug-fixes and adjustments:

    • Fix alignment of over/under symbols
    • Fix bugs in colorbars:
      • alpha of extensions
      • drawedges=True with extensions
      • handling of panchor=False
    • Fix builds on Cygwin and IBM i
    • Fix contour labels in SubFigures
    • Fix cursor output:
      • for imshow with all negative values
      • when using BoundaryNorm
    • Fix interactivity in IPython/Jupyter
    • Fix NaN handling in errorbar
    • Fix NumPy conversion from AstroPy unit arrays
    • Fix positional markerfmt passed to stem
    • Fix unpickling:
      • crash loading in a separate process
      • incorrect DPI when HiDPI screens
    Commits
    • d04c8de REL: v3.5.3
    • 318cacc DOC: Update release notes for 3.5.3
    • f4d4b47 Merge branch 'v3.5.2-doc' into v3.5.x
    • 071413e DOC: Update GitHub stats for 3.5.3
    • 0428306 Merge pull request #23591 from meeseeksmachine/auto-backport-of-pr-23549-on-v...
    • 2f3abfb Merge pull request #23593 from QuLogic/fix-flake8
    • 530457e STY: Fix whitespace error from new flake8
    • ab78318 Backport PR #23549: Don't clip colorbar dividers
    • 952227e Merge pull request #23528 from meeseeksmachine/auto-backport-of-pr-23523-on-v...
    • 632e4d7 Backport PR #23523: TST: Update Quantity test class
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • Random mode

    Random mode

    Reference Issues/PRs

    #88

    What does this implement/fix? Explain your changes.

    • random_hex_color_gen function added
    • color,bgcolor and projection parameters random mode added
    • filter_color function modified
    • filter_projection function modified

    Any other comments?

    enhancement new feature 
    opened by sepandhaghighi 2
  • Link and Path fields added

    Link and Path fields added

    Reference Issues/PRs

    #99

    What does this implement/fix? Explain your changes.

    Since we need to know what's the link of uploaded art in the nft storage we decided to return the link to the art in the when using nft_storage_upload method. Same issue when saving a config/data/art file.

    enhancement new feature 
    opened by sadrasabouri 2
  • How do you define the S1 space

    How do you define the S1 space

    I understand that in the example you provide, x and y are defined between -pi and +pi. However, how do you define this space so the image will be generated between this numbers? I think I need a deeper explanation of how the parameters in the functions work to generate the transformation.

    opened by CesarSGZ 2
  • Reproducibility Feature by Adding `python_version`

    Reproducibility Feature by Adding `python_version`

    Reference Issues/PRs

    #171

    What does this implement/fix? Explain your changes.

    This PR added the python_version attributes to the GenerativeImage object which is saved in both config and data files. At the same time, loading these files Python version would be checked to see if it's the same as the current Python version.

    bug enhancement 
    opened by sadrasabouri 1
  • Reproducibility

    Reproducibility

    Description

    It seems in some cases Python version is also important for reproducibility

    • Config 1 (matplotlib = 3.2.2):
    1. Python 3.8

    Python 3 8 2. Python 3.7 Python 3 7

    Operating System

    Windows 10

    Python Version

    3.8.0

    Samila Version (Use : samila.__version__)

    Samila 0.9

    bug 
    opened by sepandhaghighi 0
  • Make Movable Arts

    Make Movable Arts

    Description

    Beside constant pictures we may think of a gif or mp4 art which should consist of several GenerativeImage each with a slight change respected to its latest to grantee the continuity of gif.

    Steps/Code to Reproduce

    g = GenerativeGIF()
    

    Samila Version (Use : samila.__version__)

    0.1

    enhancement discussion 
    opened by sadrasabouri 0
  • Bots In Social Networks

    Bots In Social Networks

    Description

    • Telegram Bot A bot which can generate art given it's configs(#33)
    • Twitter Bot A twitter bot which generate a random Samila art each day and alternate it with its config(#33) for those who wanted to regenerate it.
    • Telegram Channel A channel that works the same like Twitter bot, but write down configs in the file caption instead.
    enhancement 
    opened by sadrasabouri 3
  • Create Samila Art From Files

    Create Samila Art From Files

    Description

    We may come up with a solid behavior toward all file types to make Samila art from them. This issue tracker will be a place to discuss about:

    • How we can come up with that general solution?

    Steps/Code to Reproduce

    It may sound like this:

    >>> g = Samila(path2file)
    

    Expected Behavior

    It will decode the file content into two functions (known as f1 and f2) and give construct a GenerativeImage instance then return it back.

    Samila Version (Use : samila.__version__)

    0.1

    enhancement discussion 
    opened by sadrasabouri 1
Releases(v1.0)
  • v1.0(Dec 14, 2022)

    • Marker enum added #156
    • get_data function added
    • get_config function added
    • marker parameter added to plot method #156
    • upload_data parameter added to nft_storage method #145
    • upload_config parameter added to nft_storage method #144
    • generate method optimized #123
    • Test system modified
    • README.md updated
    • Python 3.11 added to test.yml
    • plot method warning bug fixed #155
    • Random mode modified
    Source code(tar.gz)
    Source code(zip)
  • v0.9(Sep 28, 2022)

    • Anaconda workflow added #137
    • README.md updated
    • CODE_OF_CONDUCT.md updated
    • demo.ipynb updated
    • cmap parameter added to plot method #75
    • Random mode modified
    • Test system modified
    • generate method optimized
    • samila_help function updated
    • load_data and load_config functions error handling updated #138
    Source code(tar.gz)
    Source code(zip)
  • v0.8(Jun 1, 2022)

    • INVALID_COLOR_TYPE_ERROR error added #134
    • COLOR_NOT_FOUND_WARNING warning added #134
    • BOTH_COLOR_COMPLEMENT_WARNING warning added #134
    • set_background function added
    • is_valid_color function added
    • color_complement function added #122
    • select_color function added
    • Transparent mode support for bgcolor parameter #118
    • Random mode modified
    • Complementary color support for color and bgcolor parameters #122
    • filter_color function modified
    Source code(tar.gz)
    Source code(zip)
  • v0.7(May 4, 2022)

    • fill_data function added
    • random_hex_color_gen function added
    • color,bgcolor and projection parameters random mode added #88
    • Calculation warning added to generate method #121
    • Hex color support for color and bgcolor parameters #116
    • Test system modified
    • Random mode modified
    • filter_color function modified
    • filter_projection function modified
    • is_same_data function modified
    • README.md updated
    Source code(tar.gz)
    Source code(zip)
  • v0.6(Apr 13, 2022)

    • save_params_filter function added #100
    • __del__ method updated #110
    • message field changed in save_fig_file function #99
    • message field changed in save_config_file function #99
    • message field changed in save_data_file function #99
    • message field changed in nft_storage_upload function #99
    • depth section added to config/data file #100
    • linewidth parameter added to plot method #101
    • linewidth parameter added to plot_params_filter function #101
    • Random mode modified
    • README.md updated
    Source code(tar.gz)
    Source code(zip)
  • v0.5(Mar 21, 2022)

    • __del__ method added #91
    • Demo notebook added #77
    • depth parameter added to nft_storage method #89
    • depth parameter added to save_fig_buf function #89
    • alpha parameter added to plot method #90
    • alpha parameter added to plot_params_filter function #90
    • Random mode modified
    • README.md updated
    Source code(tar.gz)
    Source code(zip)
  • v0.4(Jan 13, 2022)

    • PLOT_DATA_ERROR error message added
    • _GI_initializer function added
    • generate_params_filter function added
    • plot_params_filter function added
    • filter_size function added
    • save_config method added #73
    • load_config function added #73
    • save_config_file function added #73
    • samilaConfigError class added #73
    • samilaPlotError class added
    • filter_float function added
    • Random equations mode added #32
    • function1_str attribute added #32
    • function2_str attribute added #32
    • README.md updated
    • plot section added to data file
    • edgecolor changed to c in plot method #74
    • config parameter added to GenerativeImage __init__ #73
    • filter_projection function edited
    • Test system updated
    • NO_FUNCTION_ERROR error message removed
    • DATA_PARSING_ERROR error message removed
    • JUST_DATA_WARNING warning message removed
    Source code(tar.gz)
    Source code(zip)
  • v0.3(Nov 10, 2021)

    • Discord channel added #66
    • load_data function added #33
    • save_data_file function added #33
    • save_data method added #33 #64
    • data parameter added to GenerativeImage __init__ #33
    • depth parameter added to save_image method
    • depth parameter added to save_fig_file function
    • save_image and nft_storage methods background bug fixed #60
    • README.md updated
    • Test system updated
    • Python 3.10 added to test.yml #65
    Source code(tar.gz)
    Source code(zip)
  • v0.2(Oct 14, 2021)

    • dependabot.yml added
    • requirements-splitter.py added
    • samila_help function added
    • test.py added #42
    • function_test.py added #42
    • is_same_data function added
    • save_image method added #41
    • dev-requirements.txt updated
    • README.md updated #43 #40
    • __main__.py updated
    • test.yml updated #42 #48
    • nft_storage method updated
    Source code(tar.gz)
    Source code(zip)
  • v0.1(Sep 30, 2021)

Owner
Sepand Haghighi
Open Source Enthusiast
Sepand Haghighi
Ascify-Art - An easy to use, GUI based and user-friendly colored ASCII art generator from images!

Ascify-Art This is a python based colored ASCII art generator for free! How to Install? You can download and use the python version if you want, modul

Akash Bora 14 Dec 31, 2022
Combinatorial image generator for generative NFT art.

ImageGen Stitches multiple image layers together into one image. Run usage: stitch.py [-h] <backgrounds_dir> <dinos_dir> <traits_dir> <texture_file> <

Dinosols NFT 19 Sep 16, 2022
Img-to-ascii-art - Converter of image to ascii art

img-to-ascii-art Converter of image to ascii art Latest Features. Intoducing Col

null 1 Dec 31, 2021
vsketch is a Python generative art toolkit for plotters

Generative plotter art environment for Python

Antoine Beyeler 380 Dec 29, 2022
Using P5.js, Processing and Python to create generative art

Experiments in Generative Art Using Python, Processing, and P5.js Quick Links Daily Sketches March 2021. | Gallery | Repo | Done using P5.js Genuary 2

Ram Narasimhan 33 Jul 6, 2022
Python Digital Art Generator

Python Digital Art Generator The main goal of this repository is to generate all possible layers permutations given by the user in order to get unique

David Cuentas Mar 3 Mar 12, 2022
An ascii art generator that's actually good. Does edge detection and selects the most appropriate characters.

Ascii Artist An ascii art generator that's actually good. Does edge detection and selects the most appropriate characters. Installing Installing with

null 18 Jan 3, 2023
QR-Generator - An awesome QR Generator to create or customize your QR's

QR Generator An awesome QR Generator to create or customize your QR's! Table of

Tristán 1 Jan 28, 2022
A python program to generate ANSI art from images and videos

ANSI Art Generator A python program that creates ASCII art (with true color support if enabled) from images and videos Dependencies The program runs u

Pratyush Kumar 12 Nov 8, 2022
👾 Python project to help you convert any image into a pixel art.

?? Pixel Art Generator Python project to help you convert any image into a pixel art. ⚙️ Developer's Guide Things you need to get started with this co

Atul Anand 6 Dec 14, 2022
Computer art based on quadtrees.

Quads Computer art based on quadtrees. The program targets an input image. The input image is split into four quadrants. Each quadrant is assigned an

Michael Fogleman 1.1k Dec 23, 2022
Convert Image to ASCII Art

Convert Image to ASCII Art Persiapan aplikasi ini menggunakan bahasa python dan beberapa package python. oleh karena itu harus menginstall python dan

Huda Damar 48 Dec 20, 2022
Convert any image into greyscale ASCII art.

Image-to-ASCII Convert any image into greyscale ASCII art.

Ben Smith 12 Jan 15, 2022
Computer art based on joining transparent images

Computer Art There is no must in art because art is free. Introduction The following tutorial exaplains how to generate computer art based on a series

Computer Art 12 Jul 30, 2022
Pixel art as well as various sets for hand crafting

Pixel art as well as various sets for hand crafting

null 1 Nov 9, 2021
Art directed cropping, useful for responsive images

Art direction sets a focal point and can be used when you need multiple copies of the same Image but also in in different proportions.

Daniel 1 Aug 16, 2022
Generate waves art for an image

waves-art Generate waves art for an image. Requirements: OpenCV Numpy Example Usage python waves_art.py --image_path tests/test1.jpg --patch_size 15 T

Hamza Rawal 18 Apr 4, 2022
A python based library to help you create unique generative images based on Rarity for your next NFT Project

Generative-NFT Generate Unique Images based on Rarity A python based library to help you create unique generative images based on Rarity for your next

Kartikay Bhutani 8 Sep 21, 2022
Python avatar generator for absolute nerds

pagan Welcome to the Python Avatar Generator for Absolute Nerds. Current version: 0.4.3 View the change history here. Remember those good old days whe

David Bothe 280 Dec 16, 2022