Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pyrender/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ def baseColorTexture(self):

@baseColorTexture.setter
def baseColorTexture(self, value):
if value and (value.mode == 'LA' or value.mode == "L"):
value = value.convert('RGBA')
self._baseColorTexture = self._format_texture(value, 'RGBA')
self._tex_flags = None

Expand Down
2 changes: 2 additions & 0 deletions pyrender/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def format_texture_source(texture, target_channels='RGB'):
texture = np.array(texture * 255.0, dtype=np.uint8)
elif np.issubdtype(texture.dtype, np.integer):
texture = texture.astype(np.uint8)
elif np.issubdtype(texture.dtype, np.bool_):
texture = texture.astype(np.uint8) * 255
else:
raise TypeError('Invalid type {} for texture'.format(
type(texture)
Expand Down