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
:rocket: A minimalist comic reader

Pynocchio A minimalist comic reader Features | Installation | Contributing | Credits This screenshots contains a page of the webcomic Pepper&Carrot by

Michell Stuttgart 73 Aug 02, 2022
Png-to-stl - Converts PNG and text to SVG, and then extrudes that based on parameters

have ansible installed locally run ansible-playbook setup_application.yml this sets up directories, installs system packages, and sets up python envir

1 Jan 03, 2022
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
Bot by image recognition simulating (random) human clicks

bbbot22 bot por reconhecimento de imagem simulando cliques humanos (aleatórios) inb4: sim, esse é basicamente o mesmo bot de 2021 porque a Globo não t

Yuri 2 Apr 05, 2022
Tweet2Image - Convert tweets to Instagram-friendly images.

Convert tweets to Instagram-friendly images. How to use If you want to use this repository as a submodule, don't forget to put the fonts d

Janu Lingeswaran 1 Mar 11, 2022
Instagram-like image filters.

PyGram Instagram-like image filters. Usage First, import the client: from filters import * Instanciate a filter and apply it: f = Nashville("image.jp

Ajay Kumar Nagaraj 0 Oct 18, 2022
LabelMe annotation tool source code

LabelMe annotation tool source code Here you will find the source code to install the LabelMe annotation tool on your server. LabelMe is an annotation

MIT CSAIL Computer Vision 1.3k Jan 03, 2023
Extracts dominating colors from an image and presents them as a palette.

ColorPalette A simple web app to extract dominant colors from an image. Demo Live View it live at : https://colorpalettedemo.herokuapp.com/ You can de

Mayank Nader 214 Dec 29, 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
Labelme is a graphical image annotation tool, It is written in Python and uses Qt for its graphical interface

Image Polygonal Annotation with Python (polygon, rectangle, circle, line, point and image-level flag annotation).

Kentaro Wada 9.6k Jan 09, 2023
An esoteric visual language that takes image files as input based on a multi-tape turing machine, designed for compatibility with C.

vizh An esoteric visual language that takes image files as input based on a multi-tape turing machine, designed for compatibility with C. Overview Her

Sy Brand 228 Dec 17, 2022
View images in the terminal using ansi escape codes and python

terminal-photo-viewer view images in the terminal using ansi escape codes and python !! Only tested on Ubuntu 20.04.3 LTS with python version 3.8.10 D

1 Nov 30, 2021
Craft PNG files that appear completely different in Apple software

Ambiguous PNG Packer Craft PNG files that appear completely different in Apple software

David Buchanan 1k Dec 29, 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
EmbedToolV2 - 2.0 Version of DraKenCodeZ/ImageEmbedTool

EmbedToolV2 - 2.0 Version of DraKenCodeZ/ImageEmbedTool

DraKenCodeZ 1 Dec 07, 2021
A pure python implementation of the GIMP XCF image format. Use this to interact with GIMP image formats

Pure Python implementation of the GIMP image formats (.xcf projects as well as brushes, patterns, etc)

FHPyhtonUtils 8 Dec 30, 2022
This repository will help you get label for images in Stanford Cars Dataset.

STANFORD CARS DATASET stanford-cars "The Cars dataset contains 16,185 images of 196 classes of cars. The data is split into 8,144 training images and

Nguyễn Trường Lâu 3 Sep 20, 2022
Hello, this project is an example of how to generate a QR Code using python 😁

Hello, this project is an example of how to generate a QR Code using python 😁

Davi Antonaji 2 Oct 12, 2021
Forza painter app with python

forza-painter Discord: A-Dawg#0001 (AE) Supports: Forza Horizon 5 Offically (OTHER v1.405.2.0, MS STORE v3.414.967.0, STEAM v1.414.967.0) Unofficially

320 Dec 31, 2022
🎶😤 Generate an image indicating what you are listening to 😳

I'm Listening to This (song that I've sent you an image about detailing its metadata in a nifty way) Few lines describing your project. 📝 Table of Co

Connor B - Viibrant 4 Nov 03, 2021