The invention relates to a process for producing thin, semiconducting films photosensitized by one or more chromophores, which comprises at least one cycle comprising, in succession, the following steps: a) a step of depositing, on a support, at least one film of a solution obtained by sol-gel polymerization of one or more precursors of a semiconducting oxide or semiconducting oxides, said semiconducting oxide or oxides being chosen from metal oxides, metalloid oxides and mixtures thereof; b) a drying step carried out on the film obtained at a); c) an acid, basic or neutral treatment step carried out in liquid or gaseous medium on the film obtained at b); and d) a step of photosensitizing the film obtained at c) by one or more chromophores, by bringing this film into contact with a solution containing the chromophore(s). Application to the production of electrodes for photovoltaic cells and to light-emitting diodes.