A method for producing a multipixel detector , the method comprising: providing (S102) a bottom layer comprising a first and a second bottom electrode; depositing (S104) an electrically insulating layer on the bottom layer ; forming (S106) a first opening through the electrically insulating layer to the first bottom electrode ; depositing (S108) a first photon absorbing material in the first opening to electrically connect to the first bottom electrode ; forming (S114) a second opening through the electrically insulating layer to the second bottom electrode ; depositing (S116) a second photon absorbing material in the second opening to electrically connect to the second bottom electrode ; planarizing (S118) the deposited electrically insulating layer , the deposited first photon absorbing material and the deposited second photon absorbing material to form a flat surface , wherein the flat surface comprises a top surface of the electrically insulating layer , a top surface of the first photon absorbing material in the first opening and a top surface of the second photon absorbing material in the second opening , separated from the top surface of the first photon absorbing material by the top surface of the electrically insulating layer ; forming (S122) a common top electrode on top of the flat surface , wherein the common top electrode electrically connects to the top surfaces of the first and second photon absorbing materials in the flat surface ; wherein the common top electrode , the first photon absorbing material in the first opening and the first bottom electrode form parts of a first thin film photodiode, first TFPD, ; and the common top electrode , the second photon absorbing material in the second opening and the second bottom electrode form parts of a second thin film photodiode, second TFPD, . providing (S102) a bottom layer comprising a first and a second bottom electrode; depositing (S104) an electrically insulating layer on the bottom layer ; forming (S106) a first opening through the electrically insulating layer to the first bottom electrode ; depositing (S108) a first photon absorbing material in the first opening to electrically connect to the first bottom electrode ; forming (S114) a second opening through the electrically insulating layer to the second bottom electrode ; depositing (S116) a second photon absorbing material in the second opening to electrically connect to the second bottom electrode ; planarizing (S118) the deposited electrically insulating layer , the deposited first photon absorbing material and the deposited second photon absorbing material to form a flat surface , wherein the flat surface comprises a top surface of the electrically insulating layer , a top surface of the first photon absorbing material in the first opening and a top surface of the second photon absorbing material in the second opening , separated from the top surface of the first photon absorbing material by the top surface of the electrically insulating layer ; forming (S122) a common top electrode on top of the flat surface , wherein the common top electrode electrically connects to the top surfaces of the first and second photon absorbing materials in the flat surface ; wherein the common top electrode , the first photon absorbing material in the first opening and the first bottom electrode form parts of a first thin film photodiode, first TFPD, ; and the common top electrode , the second photon absorbing material in the second opening and the second bottom electrode form parts of a second thin film photodiode, second TFPD, . <EOS>