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.


1 Answer 1

bpy.data.scenes["Scene"].render.image_settings.compression = 15
  • 3
    $\begingroup$ 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) $\endgroup$
    – gandalf3
    Commented Dec 23, 2014 at 22:38
  • $\begingroup$ You would have to put this in either a text block, or a .py file, and use the -P command line flag to have Blender run this script before exporting the animation. $\endgroup$
    – Skrylar
    Commented Nov 26, 2015 at 13:01
  • $\begingroup$ I embedded Blender in a python script to create a movie out of pictures. Maybe you may want to take a look at the code $\endgroup$ Commented Feb 25, 2016 at 14:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .