# How to save Denoising Data and the noisy image of Cycles Render

I'm struggling on how to save all denoising data information like albedo or normal information when rendering an image using python api.

It should be something like:

bpy.ops.render.render(use_viewport = False, write_still=True, layer="Denoising Normal")


Can anyone help me?

A little late but maybe someone needs the solution: To render images and export also their denoising information, create a group of compositor nodes, link them and just render the image as usual.

Example of what worked for me:

def use_compositor_extra_information(noisy=True, albedo=False, normal=False, dir="D:/Renderings/"):

bpy.context.scene.view_layers['View Layer'].cycles.denoising_store_passes = True
bpy.context.scene.use_nodes = True

tree = bpy.context.scene.node_tree
# clear all nodes which were there before
for node in tree.nodes:
tree.nodes.remove(node)

# create input node with all rendering layers
render_layer_node = tree.nodes.new(type='CompositorNodeRLayers')
composite_node = tree.nodes.new(type='CompositorNodeComposite')

if noisy is True:
# output of the noisy image
noisy_image_node = tree.nodes.new(type='CompositorNodeOutputFile')
noisy_image_node.base_path = os.path.normpath(dir)

if normal is True:
# output of the normal image
normal_image_node = tree.nodes.new(type='CompositorNodeOutputFile')
normal_image_node.base_path = os.path.join(dir ,"normal")

if albedo is True:
# output of the albedo image
albedo_image_node = tree.nodes.new(type='CompositorNodeOutputFile')
albedo_image_node.base_path = os.path.join(dir , "albedo")

bpy.ops.render.render(animation=False, write_still=True)