In this paper we propose a solution of the Lambertian shape-from-shading (SFS) problem by designing a new mathematical framework based on the notion of viscosity solution. The power of our approach is twofolds: (1) it defines a notion of weak solutions (in the viscosity sense) which does notnecessarily require boundary data. Moreover, it allows to characterize theviscosity solutions by their “minimums”; and (2) it unifies the works of [Rouy and Tourin, SIAM J. Numer. Anal.29 (1992) 867–884], [Lions et al., Numer. Math.64 (1993) 323–353], [Falcone and Sagona, Lect. Notes Math.1310 (1997) 596–603],[Prados et al., Proc. 7th Eur. Conf. Computer Vision2351 (2002) 790–804; Prados and Faugeras, IEEE Comput. Soc. Press2 (2003) 826–831], based on the notion of viscosity solutions and the work of [Dupuis and Oliensis, Ann. Appl. Probab.4 (1994) 287–346] dealing with classical solutions.