A new spiropyran functionalized rhodamine derivative RB-SP2 has been synthesized and applied to detect Cu2+ and S2−. RB-SP2 was then used as an imaging probe for detection of these ions in HeLa cells at the physiological pH.