  Based on a new, exact QCD factorization formula for the partial B->X_s+gamma
decay rate with a restriction on large photon energy, improved predictions are
presented for the partial moments <E_gamma> and <E_gamma^2>-<E_gamma>^2 of the
photon spectrum defined with a cut E_gamma>E_0. In the region where
Delta=m_b-2E_0 is large compared with Lambda_{QCD}, a theoretical description
without recourse to shape functions can be obtained. However, for Delta<<m_b it
is important to separate short-distance contributions arising from different
scales. The leading terms in the heavy-quark expansion of the moments receive
contributions from the scales Delta and \sqrt{m_b Delta} only, but not from the
hard scale m_b. For these terms, a complete scale separation is achieved at
next-to-next-to-leading order in renormalization-group improved perturbation
theory, including two-loop matching contributions and three-loop running. The
results presented here can be used to extract the b-quark mass and the quantity
mu_pi^2 with excellent theoretical precision. A fit to experimental data
reported by the Belle Collaboration yields
m_b^{SF}=(4.62+-0.10_{exp}+-0.03_{th})GeV and
mu_pi^{2,SF}=(0.11+-0.19_{exp}+-0.08_{th})GeV^2 in the shape-function scheme at
a scale mu_f=1.5GeV, while m_b^{kin}=(4.54+-0.11_{exp}+-0.04_{th})GeV and
mu_pi^{2,kin}=(0.49+-0.18_{exp}+-0.09_{th})GeV^2 in the kinetic scheme at a
scale mu_f=1GeV.
