freetypy.Bitmap

class freetypy.Bitmap

Describes a bitmap raster.

Bitmap supports the Python buffer interface, so it is easy to convert it to a Numpy array. For example:

>>> import numpy as np
>>> a = np.asarray(bitmap)
__init__()

x.__init__(...) initializes x; see help(type(x)) for signature

Methods

convert Convert a Bitmap to 8 bits per pixel.
to_list ⨎ Convert the bitmap to a nested list.

Attributes

buffer Get the bitmap’s contents as a buffer.
num_grays The number of gray levels used in the bitmap.
pitch The number of bytes taken by one bitmap row.
pixel_mode The PIXEL_MODE, i.e., how pixel bits are stored.
rows The number of bitmap rows.
width The number of pixels in bitmap row.