Fluorescence and photoacoustic imaging have different advantages in cancer diagnosis; however, combining effects in one agent normally requires a trade-off as the mechanisms interfere. Here, based on rational molecular design, we introduce a smart organic nanoparticle whose absorbed excitation energy can be photo-switched to the pathway of thermal deactivation for photoacoustic imaging, or to allow opposed routes for fluorescence imaging and photodynamic therapy. The molecule is made of a dithienylethene (DTE) core with two surrounding 2-(1-(4-(1,2,2-triphenylvinyl)phenyl)ethylidene)malononitrile (TPECM) units (DTE-TPECM). The photosensitive molecule changes from a ring-closed, for photoacoustic imaging, to a ring-opened state for fluorescence and photodynamic effects upon an external light trigger. The nanoparticles’ photoacoustic and fluorescence imaging properties demonstrate the advantage of the switch. The use of the nanoparticles improves the outcomes of in vivo cancer surgery using preoperative photoacoustic imaging and intraoperative fluorescent visualization/photodynamic therapy of residual tumours to ensure total tumour removal.