Skip to main content

Python library for drawing with pixels.

Project description

Drapixcol

Python library for drawing with pixels.


The create_canvas function creates a canvas with a given width and color, example:

width, height = 10, 20
canvas = create_canvas(width, height, white)

This code created an opaque canvas with a width of 10, a height of 20, and a white color,
Also, this function can be passed transparency as the fourth argument.

The pixel function paints a specific pixel a color, example:

pixel(canvas, 5, 0 , black)

This code paints a pixel on the canvas "canvas" at coordinates x=5 y=0 black,
You can also pass transparency to this function as the fifth argument.

The repeat function draws a sequence of pixels in any direction and with any space between pixels, example:

repeat(canvas, 10, 5, 10, forward, black)

This code draws a sequence of pixels on the canvas "canvas" 10 times starting at coordinate x=5 y=10 moving forward, the pixel color is black,
You can also pass transparency as the seventh argument and the distance between pixels as the eighth argument.

The save_canvas function saves the canvas at a specific size, example:

save_canvas(canvas, in100times)

This code saves the canvas "canvas" by making it 100 times bigger.


Here are all the arguments that can be passed to functions:

Colors:

black  
white  
red  
blue  
yellow  
green  
brown  
sky_blue  
light_sky_blue  
violet  
grey  
orange  
pink  
light_green  
dark_red  
null  

You can also create your own colors as all colors are stored in RGBA format.

Transparency:

translucent 
transparent  
on80  
on60  
on40  
on20  
opaque

You can also create your own transparency since all colors are stored in RGBA format.

Directions:

forward  
down  
back  
up  
down_right  
up_right  
down_left  
up_left

Enlargement:

in2times  
in5times  
in10times  
in50times  
in100times  
in200times
in500times  
in1000times

You can also create your own magnification.

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

drapixcol-1.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

drapixcol-1.2-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file drapixcol-1.2.tar.gz.

File metadata

  • Download URL: drapixcol-1.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for drapixcol-1.2.tar.gz
Algorithm Hash digest
SHA256 8c6e7c32aca620a056febc4329a1c4a5512035b5e66d7036ea11d7f6b78f5011
MD5 655efe6f4a241c1424b9868aa7d66633
BLAKE2b-256 8debf8f2ec836e250c31eed82d2eb9a6244799d8af6122f0db1b81c1f7a57112

See more details on using hashes here.

File details

Details for the file drapixcol-1.2-py3-none-any.whl.

File metadata

  • Download URL: drapixcol-1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for drapixcol-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 438d37d1b20bb757e34b6a926a856d9426ca0d624eee8606fd49b95360ecfcf1
MD5 56c9ccec4b268c5ddb944ba5de2af202
BLAKE2b-256 9a66990c446f5efd9ced3b33688870d69d3f217fab8779d28549bd53b2ec2389

See more details on using hashes here.

Supported by

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