Canvas
Canvas
¶
A Canvas is a two-dimensional drawing area of size width × height pixels using the specified dpi (dots per inch).
Info
- A canvas uses a standard color space with at least 8 bits per channel.
- Blending mode is alpha blending
- The
(0,0)
coordinates corresponds to the bottom left corner. - A typographical point is 1/72 inch.
Example
Create a new Canvas
Parameters:
Name | Type | Description | Default |
---|---|---|---|
width |
int
|
Width of the drawing area in pixels. |
required |
height |
int
|
Height of the drawing area in pixels. |
required |
dpi |
float
|
Dots per inch |
required |
render
¶
Render the canvas the to specified target. If no target is specified, return a raw image as bytes.
Example
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target |
str
|
Filename of the target |
required |