When I load an object (Wavefront .obj) into Blender a texture is automatically loaded via the .mtl file and the related .png.
What I would like to achive is to save the existing .png file under a different name / filepath, in case the user wants to export the object again. If I don’t do this e.g. the .obj is written in another folder and links to the initial origin of the .png and the user needs to remember that the texture is located at another point.
I have found some references to functions which allow modification of textures, e.g.
… but am not able to use them in a proper way to achieve what I want :(.
Any clues where I should take a look into?
Update: Sorry, looking for an hour to find a solution and once I have posted… there it is. Seems like bpy.data.images.save_render() does the trick.