Converting texture files in blender using Python I want to write a simple script that scans all the textures files in a folder containing .dds format files and then save them as .tga.
I want to know how I can:  


open the texture file
get a reference to the opened texture file
save_as (not save) .tga files (Targa)
close the opened texture file


Manually I can do the following to convert the files:


Open Blender, change to UV Editing mode from default
Click on Open image and load the desired texture image (which is .dds)
Click on Image -> save as Image and select Targa format while saving


Essentially I just want the automation of the above mentioned process!

Thank you for help!
Okay, I figured it out.

image = bpy.data.images.load("filepath_to_source")  
image.file_format = "TARGA"  
image.save_render(&lt;filepath_to_destination&gt;)


I tried using image.save() function before I posted this question, which raised a Runtime Error: 


  Image does not have any image data


and I thought I was doing something wrong. Using save_render() function seem to have fixed it. I still don't know why save() didn't/doesn't work.