Skip to main content

A Python module for generative 2d image creation

Project description

Sh🕶️des

About

Shades is a python module for generative 2d image creation.

The main abstract object is a 'shade' which will determine color based on rules, and contains methods for drawing on images.

The majority of these implement simplex noise fields to determine color resulting in images that will appear different each time they are generated.

Current existing shades are:

  • BlockColor
  • HorizontalGradient
  • VerticalGradient
  • PointGradients
  • NoiseGradient
  • DomainWarpGradient
  • SwirlOfShades

All shades have inherit internal methods that can be used for drawing on images.

Current existing methods are:

  • rectangle
  • triangle
  • shape
  • circle
  • pizza_slice
  • fill

Using Shades

Shades is designed to help make image creation easier. Here's an example:

# First shades is imported along with any required modules
import shades
import random

# The shades.Canvas() function will return a blank PIL image
canvas = shades.Canvas()

# A shade is defined like so the below creates a simplex noise gradent:
shade = shades.NoiseGradient(
    color = (200,200,200),
    noise_fields = [shades.NoiseField(scale=0.02) for i in range(3)],
    warp_size = 50
    warp_noise = (shades.NoiseField(scale=0.005),shades.NoiseField(scale=0.005))
)

# The below for loops draw a grid across the 'canvas' image
for x in range(-50, canvas.width+50, 10):
    shade.line(canvas, (x,-50), (x,canvas.height+50))

for y in range(-50, canvas.height+50, 10):
    shade.line(canvas, (-50,y), (canvas.height+50,y))

# Then normal PIL Image methods like "show" and "save" can be used on the image
canvas.show()
canvas.save('picture.png')

Installing Shades

Shades is pip installable with python -m pip install shades

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shades-0.1.2.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

shades-0.1.2-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file shades-0.1.2.tar.gz.

File metadata

  • Download URL: shades-0.1.2.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.6.9

File hashes

Hashes for shades-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9ef0cb1a36669c988a4001c770638ff9a919fe54cd167c029604f7640684730a
MD5 a71851ea9a0271616876b722b8a6e8d3
BLAKE2b-256 9dd3c7b9e2f3850770242b053f89cad433f2567dde1160a9b713433f4b6d3587

See more details on using hashes here.

File details

Details for the file shades-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: shades-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.6.9

File hashes

Hashes for shades-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a6b753fe9018536a9788bba7b9996c1152865f4085f76beab0c9ab2a7fe9d3f9
MD5 d63be53b67e0f3362a33a198d9f3a7db
BLAKE2b-256 b5b9089c929b1c01b2691dcafb7374fb08c62b9ed99a91c3bdb8c5c748533332

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page