Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert 16-bit greyscale to 8-bit when saving as JPEG #7691

Merged
merged 3 commits into from
Feb 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use RGB for webp
Doesn't support greyscale (L)
  • Loading branch information
missionfloyd authored Feb 10, 2023
commit 73a97cac11456adcda05872364c605ebcd3982ad
2 changes: 1 addition & 1 deletion modules/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def _atomically_save_image(image_to_save, filename_without_extension, extension)
if image_to_save.mode == 'RGBA':
image_to_save = image_to_save.convert("RGB")
elif image_to_save.mode == 'I;16':
image_to_save = image_to_save.point(lambda p: p * 0.0038910505836576).convert("L")
image_to_save = image_to_save.point(lambda p: p * 0.0038910505836576).convert("RGB" if extension.lower() == ".webp" else "L")

image_to_save.save(temp_file_path, format=image_format, quality=opts.jpeg_quality)

Expand Down