A method implemented in a histogram generation circuit and a control circuit configured to cooperate with the histogram generation circuit, the method comprising: receiving a first plurality of digital codes from a time-to-digital converter, TDC, associated with a respective pixel of a pixel array, the respective pixel comprising a single photon avalanche diode, SPAD, wherein the TDC has an input coupled to the SPAD to receive signals from the SPAD, based on radiation pulses received by the SPAD; generating a coarse histogram (502; 702) from the first plurality of digital codes, the coarse histogram comprising a plurality of coarse bins that collectively correspond to a coarse histogram depth range from a lower coarse histogram depth to a higher coarse histogram depth; detecting a peak coarse bin from the plurality of coarse bins, wherein the peak coarse bin corresponds to a peak coarse bin depth range from a lower coarse peak depth to a higher coarse peak depth; after receiving the first plurality of digital codes, receiving a second plurality of digital codes from the TDC; and generating a fine histogram (504; 706) from the second plurality of digital codes based on the detected peak coarse bin, the fine histogram comprising a plurality of fine bins that collectively correspond to a fine histogram depth range from a lower fine histogram depth to a higher fine histogram depth, wherein the fine histogram depth range is narrower than the coarse histogram depth range, wherein the lower fine histogram depth is lower or equal to the lower coarse peak depth, and wherein the higher fine histogram depth is higher or equal to the higher coarse peak depth, characterized in that generating the coarse histogram comprises: generating a first coarse histogram from a first portion of the first plurality of digital codes based on a first clock; generating a second coarse histogram from a second portion of the first plurality of digital codes based on an offset first clock, the second coarse histogram being generated by applying an offset of half a cycle; and combining the first and second coarse histograms to generate the coarse histogram. receiving a first plurality of digital codes from a time-to-digital converter, TDC, associated with a respective pixel of a pixel array, the respective pixel comprising a single photon avalanche diode, SPAD, wherein the TDC has an input coupled to the SPAD to receive signals from the SPAD, based on radiation pulses received by the SPAD; generating a coarse histogram (502; 702) from the first plurality of digital codes, the coarse histogram comprising a plurality of coarse bins that collectively correspond to a coarse histogram depth range from a lower coarse histogram depth to a higher coarse histogram depth; detecting a peak coarse bin from the plurality of coarse bins, wherein the peak coarse bin corresponds to a peak coarse bin depth range from a lower coarse peak depth to a higher coarse peak depth; after receiving the first plurality of digital codes, receiving a second plurality of digital codes from the TDC; and generating a fine histogram (504; 706) from the second plurality of digital codes based on the detected peak coarse bin, the fine histogram comprising a plurality of fine bins that collectively correspond to a fine histogram depth range from a lower fine histogram depth to a higher fine histogram depth, wherein the fine histogram depth range is narrower than the coarse histogram depth range, wherein the lower fine histogram depth is lower or equal to the lower coarse peak depth, and wherein the higher fine histogram depth is higher or equal to the higher coarse peak depth, generating a first coarse histogram from a first portion of the first plurality of digital codes based on a first clock; generating a second coarse histogram from a second portion of the first plurality of digital codes based on an offset first clock, the second coarse histogram being generated by applying an offset of half a cycle; and combining the first and second coarse histograms to generate the coarse histogram.