psychopy.tools.gltools.createTexImage2dFromFile

psychopy.tools.gltools.createTexImage2dFromFile(imgFile, transpose=True)[source]

Load an image from file directly into a texture.

This is a convenience function to quickly get an image file loaded into a 2D texture. The image is converted to RGBA format. Texture parameters are set for linear interpolation.

Parameters:
  • imgFile (str) – Path to the image file.

  • transpose (bool) – Flip the image so it appears upright when displayed in OpenGL image coordinates.

Returns:

Texture descriptor.

Return type:

TexImage2D


Back to top