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.0.tar.gz (3.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: drapixcol-1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for drapixcol-1.0.tar.gz
Algorithm Hash digest
SHA256 6facf57a2e69ee9b0fef30b68f411165a21b194179d041d78ab892beda2f6a40
MD5 4cd272dafd727859a1d9e71893cd322f
BLAKE2b-256 7d733ca9d7bf31c0e10fcb5a77c0c87df5d7cfc5e3340778cad3565090f34c97

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