Work to properly implement a spectral mask.
Make sure a copy of the image is used because the first image got corrupted.
Update title.
Correct indentation.