From 5baa3ecda66337c0584f0bc6c6e7af0a6c0f6320 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 13 May 2022 16:03:26 +0200 Subject: Color Management: various improvements and fixes for image saving * Respect the image file color space setitng for saving in various cases where it was previously ignored. Previously it would often use the sRGB or Linear color space even when not selected. * For the Save As operator, add a Color Space option in the file browser to choose the color space of the file. Previously this was chosen automatically, now it's possible to e.g. resave a Linear image as Linear ACES. * When changing the file format, the colorspace is automatically changed to an appropriate color space for the file format. This already happened before, but there was no visibility or control in the operator settings for this. * Don't change color space when using the Save operator to save over the same file. * Fix missing color space conversion for 16 bit PNGs, where it assumed wrongly assumed ibuf->rect would be used for saving. Add BKE_image_format_is_byte to more accurately test this. Fixes T74610 Ref T68926 Differential Revision: https://developer.blender.org/D14899 --- source/blender/compositor/operations/COM_OutputFileOperation.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/compositor/operations/COM_OutputFileOperation.cc') diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.cc b/source/blender/compositor/operations/COM_OutputFileOperation.cc index 372e0736cd2..49de275c256 100644 --- a/source/blender/compositor/operations/COM_OutputFileOperation.cc +++ b/source/blender/compositor/operations/COM_OutputFileOperation.cc @@ -219,6 +219,12 @@ OutputSingleLayerOperation::OutputSingleLayerOperation(const Scene *scene, image_input_ = nullptr; BKE_image_format_init_for_write(&format_, scene, format); + if (!save_as_render) { + /* If not saving as render, stop IMB_colormanagement_imbuf_for_write using this + * colorspace for conversion. */ + format_.linear_colorspace_settings.name[0] = '\0'; + } + BLI_strncpy(path_, path, sizeof(path_)); view_name_ = view_name; -- cgit v1.2.3