Context : Aims : We create a model for recovering the intrinsic , absorption-corrected surface brightness distribution of a galaxy and apply the model to the nearby galaxy M 31 . Methods : We constructed a galactic model as a superposition of axially symmetric stellar components and a dust disc to analyse the intrinsic absorption effects . Dust column density is assumed to be proportional to the far-infrared flux of the galaxy . Along each line of sight , the observed far-infrared spectral energy distribution was approximated with modified black body functions corresponding to dust components with different temperatures , thereby allowing us to determine the temperatures and relative column densities of the dust components . We applied the model to the nearby galaxy M 31 using the Spitzer Space Telescope far-infrared observations for mapping dust distribution and temperature . A warm and a cold dust component were distinguished . Results : The temperature of the warm dust in M 31 varies between 56 and 60 K and is highest in the spiral arms , while the temperature of the cold component is mostly 15–19 K and rises up to about 25 K at the centre of the galaxy . The intensity-weighted mean temperature of the dust decreases from T \sim 32 K in the centre to T \sim 20 K at R \sim 7 kpc and outwards . The scalelength of the dust disc is ( a _ { 0 } ) _ { \mathrm { dust } } \approx 1.8 ~ { } ( a _ { 0 } ) _ { \mathrm { stars } } . We also calculated the intrinsic U , B , V , R , I , and L surface brightness distributions and the spatial luminosity distribution . The intrinsic dust extinction in the V -colour rises from 0.25 ^ { m } at the centre to 0.4 ^ { m } -0.5 ^ { m } at R \simeq 6 - 13 kpc and decreases smoothly thereafter . The calculated total extinction-corrected luminosity of M 31 is L _ { B } = ( 3.64 \pm 0.15 ) \cdot 10 ^ { 10 } { L _ { \sun } } , corresponding to an absolute luminosity M _ { B } = -20.89 \pm 0.04 mag . Of the total B -luminosity , 20 % ( 0.24 mag ) is obscured from us by the dust inside M 31 . The intrinsic shape of the bulge is slightly prolate in our best-fit model . Conclusions :