Visual information in natural images is intrinsically sparse, which requires efficient compression methods for storage and transmission. Among lossy image compression standards, JPEG is one of the most widely used standards and is based on the Discrete Cosine Transform (DCT). In this work, we present a passive optical device for JPEG compression based on a metasurface platform. Specifically, we design a multifocal metalens array that performs a two-dimensional optical DCT, mapping each 8-by-8 pixels image block according to the JPEG standard, directly onto its corresponding cosine-frequency components in the focal plane. The resulting spectral components can then be digitally processed and encoded to implement compression. This offloads the most computationally expensive step of the JPEG pipeline to the optical domain. We validate the proposed design through numerical simulations and report on our progress towards its feasibility via a proof-of-concept experiment using the fabricated metasurface device. These results establish a scalable pathway toward high-speed, low-power image compression and optical information processing.