Giter VIP home page Giter VIP logo

generativepy's Introduction

generativepy

Generative art and graphing library for creating images and animations.

Version 23.11 notes

3D drawing is likely to change in a future release. The rest of the library is reasonably stable.

  • Switched to date based versioning
  • Add parametric plots to the graph module
  • Allow The Turtle class to accept a list of colours, and cycle through the list as the turtle draws a path.
  • Update geometry.Transform class to use generativepy matrix order rather than PyCairo matrix order.
  • Add unit matrix to math module

Usage

generativepy is a library rather an application. It provides useful functions and example code that allow you to create images and videos by writing simple Python scripts.

The library requires:

  • pycairo.
  • NumPy.
  • Pillow.
  • easy_vector.
  • moderngl (only required for 3D imaging).
  • MoviePy
  • Command line application gifsicle (only needed for GIF creation).
  • Commandline applications latex and divpng

Main functionality:

  • A simple framework for creating images, image sequences, and gifs, using pycairo.
  • Support for bitmap processing using PIL and NumPy.
  • Colour module that supports RGB, HSL and CSS colours, transparency, lerping, colormaps.
  • A simple tweening module to help with animation.
  • Geometry module for drawing shapes.
  • A graphing library for plotting 2D functions.
  • MovieBuilder supports creating video files from separate scenes.
  • Latex formula rendering
  • 3D geometry module using moderngl.
  • Math modules for vectors, matrices and abstract shapes.

Website

Visit pythoninformer.com for details:

There are also some art examples in the Generative Art section of my blog.

For detailed information of pycairo see the Computer graphics in Python ebook.

generativepy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

generativepy's Issues

Tutorial files will not run

Hello,

I am trying to run the very first tutorial file:
generativepy / tutorial/ getting-started / rectangle.py

which seems like the same code located at:
https://www.pythoninformer.com/generative-art/generativepy-tutorial/simple-image/

and it creates the following error message:

python GenerativeExample1.py
Traceback (most recent call last):
File "C:\Users\henry\Documents\Python\GenerativeExample1.py", line 3, in
from generativepy.geometry import Rectangle
File "C:\Program Files\Python39\lib\site-packages\generativepy\geometry.py", line 7, in
from easy_vector import Vector
ModuleNotFoundError: No module named 'easy_vector'

for reference, here is the folder in site-packages:
Directory of C:\Program Files\Python39\Lib\site-packages\generativepy

06/19/2022 03:02 PM

.
06/19/2022 03:02 PM ..
06/19/2022 03:02 PM 813 analytics.py
06/19/2022 03:02 PM 4,314 bitmap.py
06/19/2022 03:02 PM 15,277 color.py
06/19/2022 03:02 PM 5,184 drawing.py
06/19/2022 03:02 PM 3,072 drawing3d.py
06/19/2022 03:02 PM 4,037 formulas.py
06/19/2022 03:02 PM 38,721 geometry.py
06/19/2022 03:02 PM 3,673 geometry3d.py
06/19/2022 03:02 PM 746 gif.py
06/19/2022 03:02 PM 16,761 graph.py
06/19/2022 03:02 PM 5,650 movie.py
06/19/2022 03:02 PM 5,844 nparray.py
06/19/2022 03:02 PM 7,231 tween.py
06/19/2022 03:02 PM 1,134 utils.py
06/19/2022 03:02 PM 22 init.py
06/19/2022 03:02 PM pycache
15 File(s) 112,479 bytes
3 Dir(s) 349,695,762,432 bytes free

Thanks for your help

Missing imports (cairo, numpy) due to lack of dependencies

Issue

Package dependencies are missing in setup.cfg, meaning that pycairo and numpy have to be manually installed.

You can see the effects when running an example script after the initial installation:

pycairo

(.env) 
Lewis@DESKTOP-IAO55HG MINGW64 ~/Documents/GitHub/generativepy (fix/add-initial-dependencies)    
$ python examples/geometry/circles.py 
Traceback (most recent call last):
  File "S:\Users\Lewis\Documents\GitHub\generativepy\examples\geometry\circles.py", line 1, in <module>
    from generativepy.drawing import make_image, setup
  File "<frozen zipimport>", line 259, in load_module
  File "S:\Users\Lewis\Documents\GitHub\generativepy\.env\lib\site-packages\generativepy-2.5-py3.9.egg\generativepy\drawing.py", line 6, in <module>
ModuleNotFoundError: No module named 'cairo'

numpy

(.env) 
Lewis@DESKTOP-IAO55HG MINGW64 ~/Documents/GitHub/generativepy (fix/add-initial-dependencies)    
$ python examples/geometry/circles.py 
Traceback (most recent call last):
  File "S:\Users\Lewis\Documents\GitHub\generativepy\examples\geometry\circles.py", line 1, in <module>
    from generativepy.drawing import make_image, setup
  File "<frozen zipimport>", line 259, in load_module
  File "S:\Users\Lewis\Documents\GitHub\generativepy\.env\lib\site-packages\generativepy-2.5-py3.9.egg\generativepy\drawing.py", line 8, in <module>
ModuleNotFoundError: No module named 'numpy'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.