-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
The script treats all images as sRGB even if they have color profiles.
Handling of color profiles needs to be added in image loading.
sd-scripts/library/train_util.py
Line 2490 in 2857f21
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
woct0rdho
Metadata
Metadata
Assignees
Labels
No labels