On-demand dual-mode image modulation. (A, i) Normalized fluorescence signal for a randomly oriented diamond particle ensemble under an applied magnetic field (points, experiment; purple line, simulation). We ascribe the discrepancy to scattering effects. (A, ii) Optical modulation under 40 2 mT pulsed magnetic field showing a signal contrast 10%. (B) Optical images under 0 and 40 mT applied field showing weak 10% optical contrast. (C) The hyperpolarization sign control. MW frequency sweeps in low-to-high (high-to-low) fashion across the ESR spectrum lead to positive (negative) hyperpolarization. Shown are 7 T NMR spectra under opposite sweep conditions. (D) The MR images under opposite MW sweep conditions, showing full sign reversal and 194% modulation contrast. Here FLASH images were taken with TE = 0.6 ms and TR = 6 ms.