JPEG is an image format defined by the Joint Photographic Experts Group, which defined the original format and its wavelet-based JPEG2000 variant.

I will spare you the details of how the original JPEG format uses Discrete Cosine Transforms (I once wrote a baseline decoder for it), and simply point you toward a few interesting resources out there:

Date Link Notes
Jul 18 judge A tool to compare visually identical images and select the best quality one
Older JPEG The JPEG Group
JPEG/JPEG2000 Overview An excellent overview in PDF format
JasPer a Part-1/ISO/IEC 15444-1 compliant JPEG 2000 implementation
JJ2000 for Java