Example-based learning of codes that statistically encode general image classes is of vital importance for computational vision. Recently, non-negative matrix factorization (NMF) was suggested to provide image codes that are both sparse and localized, in contrast to established nonlocal methods like PCA. In this paper we adopt and generalize this approach to develop a novel learning framework that allows to efficiently compute sparsity-controlled invariant image codes by a well-defined sequence of convex conic programs. Applying the corresponding parameter-free algorithm to various image classes results in semantically relevant and transformation-invariant image representations that are remarkably robust against noise and quantization.