how to get construct URL from a photo uploaded in photo field using function?

how to get construct URL from a photo uploaded in photo field using function?

I need to make a function that can be used in workflow rules. when a photo is uploaded in a field (image upload field) then I need to get a string URL of that photo and assign the string to a new text field.

I need to make something like this, because my client need the URL of the photo.

could you please help me show the code how to do this? I have read this documentation but I find it hard to implement it in a workflow rules function.

especially, I don't know how to get the imageName programmatically