An optical sensor including an array of photodiodes having a first and a second photodiode, each having an optical active region and a peripheral region. The sensor further includes a metal layer having a plurality of metal wires located in the peripheral regions of the first and second photodiodes, wherein the first photodiode is connected to a first subset of metal wires of the plurality of metal wires and wherein the second photodiode is connected to a second, different subset of metal wires of the plurality of metal wires.