Commit 463ab841 authored by missionfloyd's avatar missionfloyd

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

parent ea9bd9fc
......@@ -553,6 +553,8 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
elif extension.lower() in (".jpg", ".jpeg", ".webp"):
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.save(temp_file_path, format=image_format, quality=opts.jpeg_quality)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment