Digital photosensors