I am trying to build a tool to bake textures from one UV layout to another via scripting but before baking all the textures must be loaded in blender.

I set the filepath to my image:

bpy.data.images["Image"].filepath = "/Users/John/image.jpg"

In texture panel I can see the source is set, but Can't Load Image is displayed


seems to have no effect. Only after manually clicking the reload button, the texture is refreshed. Any ideas how to reload the texture through Python, also I'm trying to run this headlessly if it matters.


.reload() function not working

  • $\begingroup$ Same issue, but appears only if an image was missed first, blender 2.78. Move / resize panels do not help. $\endgroup$ – peko Jul 11 '18 at 8:06

Hi in addition to what J. Bakker said, here is some code that I used in TexTools addon to reload all images and remove unused ones.

import bpy

# Clean up unused images
for img in bpy.data.images:
    if not img.users:

#Reload all File images
for img in bpy.data.images :
    if img.source == 'FILE' :

Hope this helps,


| improve this answer | |

The image is reloaded. the display is not updated. If you move/resize the panel, you will see that the image is updated.

Best to do that by using tag_redraw on the correct area.

| improve this answer | |

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.