We present an algorithm to estimate blocky images of the subsurface acoustic impedance (AI) from poststack seismic data. We regularize the resulting inverse problem, which is inherently ill-posed and non-unique, by means of the total variation semi-norm (TV). This allows us promote stable and blocky solutions which are, by virtue of the capability of TV to handle edges properly, adequate to model layered earth models with sharp contrasts. The use of the TV leads to a convex objective function easily minimized using a gradient-based algorithm that requires, in contrast to other AI inversion methods based on TV regularization, simple matrix-vector multiplications and no direct matrix inversion. The latter makes the algorithm numerically stable, easy to apply, and economic in terms of computational cost. Tests on synthetic and field data show that the proposed method, contrarily to conventional l2- or l1-norm regularized solutions, is able to provide blocky AI images that preserve the subsurface layered structure with good lateral continuity from noisy observations.