Skip to content

Conversation

Hirmuolio
Copy link

Convert images with icc profile into sRGB.
If the conversion fails due to image using color profile that pillow doesn't know an error is raised.

Raises error if image is an animation.
The script currently ignores GIFs. Those could be added in now. PNG and JXL can also contain animations.

When training without alpha adds white background to transparent images.
Just calling image = image.convert("RGB") on image with transparency will often result in ugly background.

Instead of raising errors the problem images could be silently ignored. But I think telling the user something is wrong is better.

Closes #2179

Copy link
Owner

@kohya-ss kohya-ss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with color profiles, but this pull request looks good overall. Please check out the comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color profiles of are not handled by the scripts

2 participants