Bob Sale wrote:what does the statement workingImg = origImg actually do?
It stores the same reference to the image in another variable. So now you have two references to the same image data. Since you said you wanted an independent copy of the image -which I understand to mean that you could change one without changing the other- that is not what you want.