1
$\begingroup$

I was trying to automate the process of adding an image in the image editor through python. Well i kind of succeeded, but only in changing the resolution and not the color/alpha values. I seem to be lost at this part, i want the alpha value of the image to be 0 and i cant seem to find a way to automate that through python.

enter image description here

How can i change the alpha value of the image im adding through python ?

$\endgroup$
  • 2
    $\begingroup$ Please post code as text. $\endgroup$ – batFINGER Sep 20 '17 at 4:29
3
$\begingroup$

Color is a parameter of bpy.ops.image.new():

bpy.ops.image.new(name="Untitled", width=1024, height=1024, color=(0.0, 0.0, 0.0, 1.0), alpha=True, generated_type='BLANK', float=False, gen_context='NONE', use_stereo_3d=False)

bpy.ops.image.new in API

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.