2 def __init__(self, tex_node, channels):
3 self.image = tex_node.image
5 self.srgb = self.image.colorspace_settings.name=='sRGB'
6 if len(channels)==1 and self.srgb:
7 raise Exception("Unsupported configuration on texture {}: Grayscale with sRGB".format(self.image.name))
10 self.pixelformat = 'SRGB8_ALPHA8' if self.srgb else 'RGBA8'
11 elif len(channels)==1:
12 self.pixelformat = 'LUMINANCE8' if channels[0]=='Y' else 'R8'
14 self.pixelformat = 'SRGB8' if self.srgb else 'RGB8'
16 self.width = self.image.size[0]
17 self.height = self.image.size[1]