def image_data_as_rgb(self, update_image=True):
    converted_image = self.image
    if (converted_image.mode not in ['RGB', 'RGBA']):
        if ('A' in converted_image.mode):
            converted_image = converted_image.convert('RGBA')
        elif (converted_image.mode == 'P'):
            converted_image = converted_image.convert(None)
        else:
            converted_image = converted_image.convert('RGB')
    if update_image:
        self.image = converted_image
    return (converted_image.mode, converted_image.tobytes())
def image_data_as_rgb(self, update_image=True):
    converted_image = self.image
    if (converted_image.mode not in ['RGB', 'RGBA']):
        if ('A' in converted_image.mode):
            converted_image = converted_image.convert('RGBA')
        elif (converted_image.mode == 'P'):
            converted_image = converted_image.convert(None)
        else:
            converted_image = converted_image.convert('RGB')
    if update_image:
        self.image = converted_image
    return (converted_image.mode, converted_image.tobytes())