Skip to main content
2 of 2
added 231 characters in body
Chris Degnen
  • 31.4k
  • 2
  • 57
  • 112

You can use the name to find the path, but not the image variable.

name = "image.png"; img = Import[name] FindFile[name] 

FindFile finds the same file that Import finds. If you have another image with the same name in a different directory, by changing to that directory (with SetDirectory) Import and FindFile will find the second image.

Chris Degnen
  • 31.4k
  • 2
  • 57
  • 112