Absolute path of files in Blender (with Python)
The // prefix is Blender specific to denote relative paths used within Blender,

To use Python's filesystem functions you'll have to first expand this using:


bpy.path.abspath, to replace os.path.abspath
bpy.path.relpath, to replace os.path.relpath


eg:

filepath_full = bpy.path.abspath(image.filepath, library=image.library)


Unlike ./, which simply expands the current-working-directory (os.getcwd()), Blender supports library-linked files. This means the directory of the current data-block could be a different path then the currently open Blend file.

If you are operating data which the script created, You can skip passing the library argument.

filepath_full = bpy.path.abspath(image.filepath)


Note that this isn't specific to images, it works for movie-clip, sounds, sequencer and text blocks too.