# Rendering in color mode 'BW' is darker than mean pixel values

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 python interface?

• The Blender compositor can adjust the color completely. The color ramp node can adjust color. You may want to see if the color managment in Blender is affecting the save. Also there are at least 3 acceptable ways of converting to BW. Average Weight, Luminance Weight and Lightness Weight which can be searched. I have not mentioned Python because you may not need any change to your Python. Jul 18, 2018 at 17:32
• What is your file format? Jul 18, 2018 at 18:31
• This has to do with the rabbit hole of colour management. Best to hunt through the many answers here. Jul 19, 2018 at 8:43