create Function

Defined in pyglet.image

create(width, height, pattern=None)

Create an image optionally filled with the given pattern.

Note:

You can make no assumptions about the return type; usually it will be ImageData or CompressedImageData, but patterns are free to return any subclass of AbstractImage.

Parameters:
  • width (int) – Width of image to create
  • height (int) – Height of image to create
  • pattern (ImagePattern or None) – Pattern to fill image with. If unspecified, the image will initially be transparent.
Return type:

AbstractImage

Previous topic

color_as_bytes Function

Next topic

get_buffer_manager Function