# saving image from Blender to a specific path

I'm trying to save an image to a path which the user can choose, but I always get the error-message:

line 64, in execute image.save_render(path+"output/Image0"+str(counter)+".png", scene) RuntimeError: Error: Could not write image '//../../../testOut/output/Image00.png' 

here's how the var path is set:

path = bpy.props.StringProperty(default="/", subtype="FILE_PATH")


[...]

path = self.path

scene.render.image_settings.file_format='PNG'
image.save_render(path+"output/Image0"+str(counter)+".png", scene)


image.save_render() cannot use relative paths, which are returned by default by "FILE_PATH" StringProperties. To convert the path to absolute, you can simply do:

path = bpy.path.abspath(self.path)

• @user5602 If this answer has satisfactorily answered your question, consider marking it as accepted by clicking the checkmark next to it :) – gandalf3 Aug 13 '14 at 19:22