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
An automated Comic Book downloader (cbr/cbz) for use with SABnzbd, NZBGet and torrents

Mylar Note that feature development has stopped as we have moved to Mylar3. EOL for this project is the end of 2020 and will no longer be supported. T

979 Dec 13, 2022
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
Program for analyzing shadows from Cassini images

Moons: An Analysis Module for Vicar Files General This packages/program was created for my bachelor's thesis for the Astronomy department at Universit

Joni 1 Jul 16, 2021
Advance Image Steganography

Chaya Advance Image Steganography Using LSB-LPS + AES-256-GCM + FLIF Right To Privacy! United Nations Declaration of Human Rights (UDHR) 1948, Article

XeroHack 113 Dec 02, 2022
A QR Code encode and decode python module

A QR Code encode and decode python module

Fayas Noushad 4 Feb 10, 2022
This script is for photographers to do timeslice with one click.

One Click TimeSlice Tool What is this for This is for photographers who want to create TimeSlice pictures without installing PS plugins. Before using

Xi Zhao 13 Sep 23, 2022
Python script to generate vector graphics of an oriented lattice unit cell

unitcell Python script to generate vector graphics of an oriented lattice unit cell Examples unitcell --type hexagonal --eulers 12 23 34 --axes --crys

Philip Eisenlohr 2 Dec 10, 2021
A simple image-level annotation tool supporting multi-channel images for napari.

napari-labelimg4classification A simple image-level annotation tool supporting multi-channel images for napari. This napari plugin was generated with

4 May 16, 2022
Next-generation of the non-destructive, node-based 2D image graphics editor

Non-destructive, node-based 2D image graphics editor written in Python, focused on simplicity, speed, elegance, and usability

Gimel Studio 238 Dec 30, 2022
The ctypes-based simple ImageMagick binding for Python

Wand Wand is a ctypes-based simple ImageMagick binding for Python, supporting 2.7, 3.3+, and PyPy. All functionalities of MagickWand API are implement

Eric McConville 1.2k Dec 30, 2022
This is a python project which detects color of an image when you double click on it.

This is a python project which detects color of an image when you double click on it. You have to press ESC button to close the pop-up Image window. There are mainly two library CV2 and Pandas that a

Yashwant Kumar Singh 0 Aug 16, 2022
clesperanto is a graphical user interface for GPU-accelerated image processing.

clesperanto is a graphical user interface for a multi-platform multi-language framework for GPU-accelerated image processing. It is based on napari and the pyclesperanto-prototype.

1 Jan 02, 2022
A simple programme for converting url into a qr code (.png file)

QrTk A simple lightweight programme for converting url into a qr code (.png file) Pre-Requisites Before installing the programme , you need to run the

Juss Patel 4 Nov 08, 2021
Pixel Brush Processing Unit

Pixel Brush Processing Unit The Pixel Brush Processing Unit (PBPU for short) is a simple 4-Bit CPU I designed in Logisim while I was still in school a

Pixel Brush 2 Nov 03, 2022
Create a static HTML/CSS image gallery from a bunch of images.

gallerize Create a static HTML/CSS image gallery from a bunch of images.

Jochen Kupperschmidt 19 Aug 21, 2022
Multi-view 3D reconstruction using neural rendering. Unofficial implementation of UNISURF, VolSDF, NeuS and more.

Multi-view 3D reconstruction using neural rendering. Unofficial implementation of UNISURF, VolSDF, NeuS and more.

Jianfei Guo 683 Jan 04, 2023
Extract the temperature data of each wire from the thermal imager raw data.

Wire-Tempurature-Detection Extract the temperature data of each wire from the thermal imager raw data. The motivation of this computer vision project

JohanAckerman 1 Nov 03, 2021
Easily turn large sets of image urls to an image dataset. Can download, resize and package 100M urls in 20h on one machine.

img2dataset Easily turn large sets of image urls to an image dataset. Can download, resize and package 100M urls in 20h on one machine. Also supports

Romain Beaumont 1.4k Jan 01, 2023
Extracts random colours from an image

EXTRACT COLOURS This repo contains all the project files. Project Description A Program that extracts 10 random colours from an image and saves the rg

David .K. Danso 3 Dec 13, 2021
Small wrapper around 3dmol.js and html2canvas for creating self-contained HTML files that display a 3D molecular representation.

Description Small wrapper around 3dmol.js and html2canvas for creating self-contained HTML files that display a 3D molecular representation. Double cl

David Meijer 1 Dec 02, 2021