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
Design custom QR codes with this web app!

My-QR.Art This web app lets users design their own QR codes to any domain. It can be acessed on my-qr.art. You can find some more background info abou

Marien Raat 406 Dec 20, 2022
Generate different types of random avatars.

avatar-generator Generate different types of random avatars. Requirements Python3 pytorch=1.6 cv2=3.4 tqdm 1. Github-like avatars python generate_gi

Ming 11 Apr 02, 2022
👷 Build images with images

👷 Build images with images. About Tiler is a tool to create an image using all kinds of other smaller images (tiles). It is different from other mosa

5.5k Jan 03, 2023
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
Simple AI app that is guessing color of apple in picture

Apple Color Determinant Application that is guessing color of apple from image Install Pillow, sklearn and numpy, using command for your package manag

Gleb Nikitin 1 Oct 25, 2021
Random collage/montage generator with drop-shadow

Random Collage Example Usage These are the sample input files in $PWD for the below examples: 1.png 2.png 3.png 4.png 5.png 6.png 7.png 8.png 9.png 10

M B 1 Dec 07, 2021
A SIXEL encoder/decoder implementation derived from kmiya's sixel

libsixel What is this? This package provides encoder/decoder implementation for DEC SIXEL graphics, and some converter programs. (https://youtu.be/0Sa

Hayaki Saito 2k Jan 09, 2023
pix2tex: Using a ViT to convert images of equations into LaTeX code.

The goal of this project is to create a learning based system that takes an image of a math formula and returns corresponding LaTeX code.

Lukas Blecher 2.6k Dec 30, 2022
Napari 3D Ortho Viewer - an ortho viewer for napari for 3D images

napari-3d-ortho-viewer Napari 3D Ortho Viewer - an ortho viewer for napari for 3D images This napari plugin was generated with Cookiecutter using @nap

niklas netter 5 Nov 28, 2022
Manipulate EXIF and IFD metadata.

Tyf Copyright Distribution Support this project Buy Ѧ and: Send Ѧ to AUahWfkfr5J4tYakugRbfow7RWVTK35GPW Vote arky on Ark blockchain and earn Ѧ weekly

16 Jan 21, 2022
DrawBot is a powerful, free application for macOS that invites you to write Python scripts to generate two-dimensional graphics

DrawBot is a powerful, free application for macOS that invites you to write Python scripts to generate two-dimensional graphics.

Frederik Berlaen 344 Jan 06, 2023
thumbor is an open-source photo thumbnail service by globo.com

Survey If you use thumbor, please take 1 minute and answer this survey? It's only 2 questions and one is multiple choice!!! thumbor is a smart imaging

Thumbor (by @globocom) 9.3k Dec 31, 2022
Png2Jpg tool will help you convert from png image format to jpg images format.

PNG 2 JPG All codes assume running from root directory. Please update the sys path at the beginning of the codes before running. Over View Png2Jpg too

Nguyễn Trường Lâu 2 Dec 27, 2021
Nanosensor Image Processor (NanoImgPro), a python-based image analysis tool for dopamine nanosensors

NanoImgPro Nanosensor Image Processor (NanoImgPro), a python-based image analysis tool for dopamine nanosensors NanoImgPro.py contains the main class

1 Mar 02, 2022
QR Generator using GUI with Tinker

BinCat Token System Very simple python script with GUI that generates QR codes. It don't include a QR "decription" tool. It only generate-it and thats

Hipotesi 1 Nov 06, 2021
Create QR Code for link using Python

Quick Response QR is short and named for a quick read from a cell phone. Used to view information from transitory media and put it on your cell phone.

Coding Taggers 1 Jan 09, 2022
🖼️ Draw Images or GIFs in your terminal

Drawitor Draw Images/GIFs in your terminal. Install pip install drawitor CLI Tool drawitor cat_dancing.gif Library The library is written in a simple

Eliaz Bobadilla 7 Dec 15, 2022
CropImage is a simple toolkit for image cropping, detecting and cropping main body from pictures.

CropImage is a simple toolkit for image cropping, detecting and cropping main body from pictures. Support face and saliency detection.

Haofan Wang 15 Dec 22, 2022
a lite weight photo editor written in python for day to day photo editing!

GNU-PhotoShop A lite weight Photo editing Program (currently CLI only) written in python3 for day to day photo editing. Disclaimer : Currently we don'

Kunal Sharma 5 May 30, 2022
Viewer for NFO files

NFO Viewer NFO Viewer is a simple viewer for NFO files, which are "ASCII" art in the CP437 codepage. The advantages of using NFO Viewer instead of a t

Osmo Salomaa 114 Dec 29, 2022