  We determine the underlying shapes of spiral and elliptical galaxies in the
Sloan Digital Sky Survey Data Release 6 from the observed distribution of
projected galaxy shapes, taking into account the effects of dust extinction and
reddening. We assume that the underlying shapes of spirals and ellipticals are
well approximated by triaxial ellipsoids. The elliptical galaxy data are
consistent with oblate spheroids, with a correlation between luminosity and
ellipticity: the mean values of minor to middle axis ratios are 0.41+-0.03 for
Mr ~ -18 ellipticals, and 0.76+-0.04 for Mr ~-22.5 ellipticals. Ellipticals
show almost no dependence of axial ratio on galaxy colour, implying a
negligible dust optical depth.
  There is a strong variation of spiral galaxy shapes with colour indicating
the presence of dust. The intrinsic shapes of spiral galaxies in the SDSS-DR6
are consistent with flat disks with a mean and dispersion of thickness to
diameter ratio of (21+-2)%, and a face-on ellipticity, e, of ln(e)=-2.33+-0.79.
Not including the effects of dust in the model leads to disks that are
systematically rounder by up to 60%. More luminous spiral galaxies tend to have
thicker and rounder disks than lower-luminosity spirals. Both elliptical and
spiral galaxies tend to be rounder for larger galaxies.
  The marginalised value of the edge-on r-band dust extinction E_0 in spiral
galaxies is E_0 ~ 0.45 magnitudes for galaxies of median colours, increasing to
E_0=1 magnitudes for g-r>0.9 and E_0=1.9 for the luminous and most compact
galaxies, with half-light radii <2kpc/h.
