A technique for block-loss restoration in block-based image and video coding, dubbed recovery of image blocks using the method of alternating projections (RIBMAP), is developed. The algorithm is based on orthogonal projections onto constraint sets in a Hilbert space. For the recovery of a linear dimension N size block, a total of 8N vectors are extracted from the surrounding area of an N × N missing block. These vectors form a library from which the best matching spatial information for the missing block is extracted. Recovery vectors, including both undamaged and restored damaged pixels, are introduced. The vectors are used to find highly correlated information relating to the lost pixels. To assure continuity with the surrounding undamaged area, three additional convex constraints are formulated. Adherance to these sets is imposed using alternating projections. Simulation results using orthogonal projections demonstrate that RIBMAP recovers spatial structure faithfully. Simulation comparisons with other procedures are presented: Ancis and Giusto's hybrid edge-based average-median interpolation technique, Sun and Kwok's projections onto convex sets-based method, Hemami and Meng's interblock correlation interpolation approach, Shirani et al.'s modified interblock correlation interpolation scheme, and Alkachouh and Bellanger's fast discrete cosine transformation-based spatial domain interpolation algorithm. Characteristic of the results are those of the "Lena" JPEG image when one fourth of periodically spaced blocks in the image have errors. The peak signal-to-noise ratio of the restored image is 28.68, 29.99, 31.86, 31.69, 31.57, and 34.65 dB using that of Ancis and Giusto, Sun and Kwok, Hemami and Meng, Shirani et al., Alkachouh and Bellanger, and RIPMAP, respectively.