The Format Matrix and Alpha Channels
Each target format is a different contract. Baseline and progressive JPEG store 8-bit YCbCr and cannot carry transparency; PNG keeps 8- or 16-bit RGBA, palette indices and an alpha channel; WebP has lossy, lossless and alpha variants; AVIF adds 10- and 12-bit depth and film-grain synthesis; GIF limits you to 256 colours and one transparent index.
Alpha is where most conversions go wrong. Flattening a transparent PNG onto white and saving as JPEG gives a clean result, while dropping the channel without a matte yields black fringes around anti-aliased edges. Premultiplied versus straight alpha is a second trap: compositing twice darkens semi-transparent pixels, a defect visible mainly on soft shadows and glass.