An image sensor, comprising: an array of metasurface structures and an array of optical-to-electrical conversion units, wherein the array of metasurface structures is located above the array of photoelectric conversion units; and the optical-to-electrical conversion unit comprises a plurality of optical-to-electrical conversion elements, each optical-to-electrical conversion element in the optical-to-electrical conversion unit corresponds to one frequency band in a spectrum, the metasurface structure comprises a first substrate and a microstructure located above the first substrate, the microstructure and the first substrate are configured to transmit an optical signal at each frequency band to an optical-to-electrical conversion element corresponding to each frequency band, the microstructure is a rotationally symmetric structure, and a rotation angle of the rotationally symmetric structure is less than or equal to 90 degrees, wherein the microstructure and the first substrate are configured to generate a spatial transmission phase in a tangential direction of the array of metasurface structures, to obtain a spatial transmission phase gradient, wherein the spatial transmission phase gradient is used to transmit the optical signal at each frequency band to the optical-to-electrical conversion element corresponding to each frequency band, wherein the spatial transmission phase is related to a wavelength of the optical signal at each frequency band, a position at which the optical signal at each frequency band is incident to the metasurface structure, a position at which the optical signal at each frequency band is transmitted to the optical-to-electrical conversion element corresponding to each frequency band, and a refractive index of a medium between the metasurface structure and the optical-to-electrical conversion element wherein the medium comprises a second substrate. the optical-to-electrical conversion unit comprises a plurality of optical-to-electrical conversion elements, each optical-to-electrical conversion element in the optical-to-electrical conversion unit corresponds to one frequency band in a spectrum, the metasurface structure comprises a first substrate and a microstructure located above the first substrate, the microstructure and the first substrate are configured to transmit an optical signal at each frequency band to an optical-to-electrical conversion element corresponding to each frequency band, the microstructure is a rotationally symmetric structure, and a rotation angle of the rotationally symmetric structure is less than or equal to 90 degrees, wherein the microstructure and the first substrate are configured to generate a spatial transmission phase in a tangential direction of the array of metasurface structures, to obtain a spatial transmission phase gradient, wherein the spatial transmission phase gradient is used to transmit the optical signal at each frequency band to the optical-to-electrical conversion element corresponding to each frequency band, wherein the spatial transmission phase is related to a wavelength of the optical signal at each frequency band, a position at which the optical signal at each frequency band is incident to the metasurface structure, a position at which the optical signal at each frequency band is transmitted to the optical-to-electrical conversion element corresponding to each frequency band, and a refractive index of a medium between the metasurface structure and the optical-to-electrical conversion element wherein the medium comprises a second substrate.