Most image-format bugs I see in code review aren't exotic. A logo ships as a 900 KB JPG with fuzzy edges. A hero photo ships as a PNG that weighs more than the rest of the page combined. A product cut-out loses its transparency and shows up on a white box over a dark theme. All three come from the same gap: picking a format by habit instead of by what the pixels are.
Here's the rule of thumb I actually use.
First, know what you're compressing
A 1920×1080 image is 2,073,600 pixels. Stored raw with an alpha channel (4 bytes per pixel), that's 8,294,400 bytes — about 8.3 MB before any compression. Every format below is a different strategy for shrinking that number, and each one is good at a different kind of image.
PNG is lossless. It reproduces every pixel exactly and supports full alpha transparency. It compresses well when the image has large flat areas and repeated patterns — UI, text, diagrams, icons.
JPG is lossy.…