Hey @Gregor-M,
so, had a look, and it is mostly as I said.
The actual bitmaps saved to disk are the same in your case and correct. The reason why your script produces bitmaps that will look differently in Photoshop or an external image viewer, is because you set the BaseBitmap::COLORPROFILE_INDEX_IMAGE profile to a linear sRGB profile. A manually started rendering will there usually use sRGB2.1. If you wanted to do this correctly, you would have to take the image color profile from the render settings (but since the user will usually have the default value there, this does not really make a difference in most cases):
rd: c4d.BaseContainer = doc.GetActiveRenderData().GetClone().GetData() bmp: c4d.bitmaps.BaseBitmap = c4d.bitmaps.BaseBitmap() bmp.Init(int(rd[c4d.RDATA_XRES]), int(rd[c4d.RDATA_YRES]), 32) bmp.SetColorProfile(rd[c4d.RDATA_IMAGECOLORPROFILE]])But bitmaps have more than one color profile since OCIO was introduced, they also have a profile for the render space, view transform, and display space. In Python, you cannot yet set these from code yet, as BaseBitmap.Get/SetProfile lacks the index argument there, and you also cannot access these profiles in the document.
After some deep dive into our render pipeline, we found out that this profile data is still incorrectly being copied, the bitmap never gets the correct view transform and display sapce profile assigned.
Independently of this, we implemented OCIO for Python, but it will not yet make it into the upcoming 2025.1 release. There is currently no way for Python API users to fix this on their side. This also impacts C++, and there are some hoops to jump through there too. You cannot just get the view transfrom profile for the view transform for the render document and set that. Because that is the actual trasnform chain, i.e., view transform + display space, e.g., "ACES 1.0 SDR-video + sRGB2.1". Set on the bitmap must be the raw view transform profile, e.g., "ACES 1.0 SDR-video. When someone runs into this, and needs C++ code to do this right now, please drop a note here.Finally, to reiterate:
This only impacts how images are displayed in the PictureViewer when shown via ShowBitmap. The actual content of the bitmaps is correct. The OCIO profiles of the bitmap are incorrect at the moment (which impacts the Picture Viewer). We will fix this, one of our developers is working on it. But we decided not to do the fix in the SDK (RenderDocument) as the core issue lies deeper within the rendering pipeline.Cheers,
Ferdinand