freetypy.Bitmap¶
-
class
freetypy.Bitmap¶ A structure used to describe a bitmap or pixmap to the raster.
Bitmapsupports 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)
Attributes
bufferGet the bitmap’s contents as a buffer. num_graysThe number of gray levels used in the bitmap. pitchThe pitch’s absolute value is the number of bytes taken by one bitmap row, including padding. pixel_modeThe PIXEL_MODE, i.e., how pixel bits are stored.rowsThe number of bitmap rows. widthThe number of pixels in bitmap row. Methods
convertConvert a Bitmapto 8 bits per pixel.to_list⨎ Convert the bitmap to a nested list.