Skip to content

Color profiles of are not handled by the scripts #2179

@Hirmuolio

Description

@Hirmuolio

The script treats all images as sRGB even if they have color profiles.

Handling of color profiles needs to be added in image loading.

def load_image(image_path, alpha=False):

Something like this:

image = Image.open( path )
icc = image.info.get('icc_profile', '') # Get color profile in the image
if icc:
    src_profile = ImageCms.ImageCmsProfile( io.BytesIO(icc) )
    srgb_profile = ImageCms.createProfile("sRGB")
    image = ImageCms.profileToProfile(image, src_profile, srgb_profile) # Convert image to sRGB

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions