saved rendered image missing color management

i wanted a script for 2.54 to render my scene at different resolutions. i came up with this:


import bpy

scn = bpy.context.scene
sizes = [256, 128]

for size in sizes:
    scn.render.resolution_x=size
    scn.render.resolution_y=size
    bpy.ops.render.render()
    img = bpy.data.images['Render Result']
    print("image size: %s, %s" % (img.size[0], img.size[1]))
    img.save_render(filepath='/tmp/icon-%s.png' % size)

my only problem is that the image saved does seem to take into account the color management and properly account for gamma correction. the size information is also 0’s, fwiw.

is there a more correct way to do this or is this a bug?

thanks.