Change material texture by loading an external .png file with Python
Let's say I have a plane with an image texture called leaf1.png and I want to change the texture to leaf2.png.

If I hover my mouse over the source area, I can see some text at the bottom of the tooltip that says how to access that data with python. Like this:



From this, I know that I can access this with python using bpy.data.images['leaf1.png'].filepath

So to change the image source with python, I do:

import bpy

bpy.data.images['leaf1.png'].filepath = 'path/to/leaf2.png'