JPG uses lossy compression to reduce file size, sacrificing some image quality. It works best for photos but can reduce clarity of simple graphics. GIF uses lossless compression and supports animation and transparency but is limited to 256 colors. PNG was developed as a patent-free alternative to GIF, offering better compression than GIF with support for transparency and preservation of quality when images are edited.