Saving a image using

Hi all. I need help in saving a color pass image of a recent rendered image. First I need to render the image using - bpy.ops.render.render(write_still=True) then I need to add soem filters in the final rendered image then save that as a color pass image. Basically need to call the while running blender in background. Please let me know if this is achievable or not

you haven’t provided enough detail to go into any sort of depth, but generally speaking- what you’re wanting to do should be possible.

you will need to use a render_post handler to know when the render is finished, after which you can perform whatever tasks you need before calling the operator.

is it possible to save COMPOSITING image by code while running blender in background. I tried using below lines but it only works while blender is open but not wokring in backgroound rendering

com_imgs = [i for i in if i.type == ‘COMPOSITING’]
for img in com_imgs:
if img.has_data:

img.has_data is always false when running blender in background
It works when running this code inside blender

Previously I found I had to save the images to disk when using the compositor in the background otherwise the image never seemed to update…

If you can find a way to make it work I would love to know… But saving to disk is a workaround…

This problem only seems to happen when running background mode.