The applications of hyperspectral imaging across disciplines such as healthcare, automobiles, forensics, and astronomy are constrained by the requirement for intricate filters and dispersion lenses. By utilization of devices with engineered spectral responses and advanced signal processing techniques, the spectral imaging process can be made more approachable across various fields. We propose a spectral response design method employing photon-trapping surface textures (PTSTs), which eliminates the necessity for external diffraction optics and facilitates system miniaturization. We have developed an analytical model to calculate electromagnetic wave coupling using the effective refractive index of silicon in the presence of PTST. We have extensively validated the model against simulations and experimental data, ensuring the accuracy of our predictions. We observe a strong linear relationship between the peak coupling wavelength and the PTST period along with a moderate proportional relation to the PTST diameters. Additionally, we identify a significant correlation between inter-PTST spacing and wave propagation modes. The experimental validation of the model is conducted using PTST-equipped photodiodes fabricated through complementary metal-oxide-semiconductor-compatible processes. Further, we demonstrate the electrical and optical performance of these PTST-equipped photodiodes to show high speed (response time: 27 ps), high gain (multiplication gain, M: 90), and a low operating voltage (breakdown voltage: ∼ 8.0 V). Last, we utilize the distinctive response of the fabricated PTST-equipped photodiode to simulate hyperspectral imaging, providing a proof of principle. These findings are crucial for the progression of on-chip integration of high-performance spectrometers, guaranteeing real-time data manipulation, and cost-effective production of hyperspectral imaging systems.