How to turn off gamma correction with Python in Blender 2.69 I'm trying to render surface normals for my scene, and I've gotten it to work in Blender 2.78. One of the important steps was to eliminate the gamma correction which was whitening the image. I did this in 2.78 by doing

scene.view_settings.view_transform = 'Raw'


Unfortunately I also need this to work in Blender 2.69, but I can't find the appropriate setting as the 'Raw' enum was introduced after 2.69.

I've tried setting it to 'NONE' (which the Blender 2.69 API lists as an option) but this throws an error saying that the only option is 'Default'. I've also tried directly setting 

scene.view_settings.gamma = 0.0


But this has no effect. 



Update: Thanks for your answer, Troy. Ultimately I'm trying to create a png image with the surface normals that I'll use for another task. This other task needs me to remap the colors of the surface normals (to look like this: https://arxiv.org/pdf/1411.4958v1.pdf).

I'm definitely open to using another path to producing normals, but I need to use only Python scripting. Non-color Data sounds promising. Would I be able to render something using nodes, and then save that render (from an output node, not from the RenderLayer) as Non-color Data? Please let me know if I'm not being clear! 



Update 2: Thanks, Sambler. When I set scene.display_settings.display_device = 'XYX' I get TypeError: bpy_struct: item.attr = val: enum "XYZ" not found in ('sRGB'). 

Trying to change 

scene.display_settings.display_device = 'sRGB'
scene.view_settings.view_transform = 'Raw'


yields TypeError: bpy_struct: item.attr = val: enum "Raw" not found in ('Default') 

This question seems pertinent. In this question the solution was to reinstall Blender. As I'm working on a shared cluster, to ask the admin to reinstall Blender in order to help me debug is, ideally, a last resort.
Wrong approach.

Simply render or load an image and tag it as Non-color Data in the UV Image editors properties panel. Being a good imager, you are already using the EXR format exclusively, as it is a linearized, high precision encoding format for both colour and data.

The Non-color Data tag keeps the buffer entirely out of the colour transform pipeline.


  I'm definitely open to using another path to producing normals, but I need to use only Python scripting. Non-color Data sounds promising. Would I be able to render something using nodes, and then save that render (from an output node, not from the RenderLayer) as Non-color Data? Please let me know if I'm not being clear!


The colour transform tag on an image buffer is only metadata, and as such, if you save that buffer as an EXR, there is nothing more that you need to do. Simply load the EXR, then use Python to set the buffer's tag to Non-Color Data and you are done. Those values will not be put through any view transform.

It should be noted that when viewing Non-Color Data in the viewport, it might seem that the view is identical to when it is set to linear. The difference is that linear is defined as a colour transform and will get passed through various transforms, where, as stated above, Non-Color Data always will pass through untransformed.