# Blender Image compression from command line

I am running blender from command line and using some scripts.In order to reduce the output size, I'd like compress the .png output file.I understand that this can be done in Blender GUI. However, I am struggling to find a way of doing it in command line or in script file.

bpy.data.scenes["Scene"].render.image_settings.compression = 15

• Welcome to the site :) Perhaps you could add some detail on how this works and how it can be used from the command line? (also it might be better to use bpy.context, otherwise it won't work if the OP's scene isn't named Scene) – gandalf3 Dec 23 '14 at 22:38