I want to render greyscale images. I do this with a large script, so I would like to do this in Blender directly and not as postprocessing with another tool.
When I set
bpy.context.scene.render.image_settings.color_mode = 'BW',
I get greyscale images, but the image is a bit darker. How does Blender compute the greyscale pixel values? It seems not to be the mean over all three channels which I checked.
Indeed, the behavior is somewhat strange: When I save the render in the UI via
save as Image it seems to use the maximum value of the color channels. However, when I save the render using
bpy.bpy.ops.render.render(write_still=True) the image is different. I am not sure but looking at several pixel values it is always 2 above the minimum, which makes the image darker when one channel has small values.
Can anyone tell me how to correctly export images in greyscale via the