According to DEV Community, most image-format mistakes in code review are ordinary ones. A logo ships as a large JPG with fuzzy edges. A hero photo ships as a PNG heavier than the rest of the page. A cut-out product image loses its transparency. The author says all three come from choosing a format by habit rather than by what the pixels contain.
The post describes each format. PNG is lossless, meaning it keeps every pixel exactly, and it supports full transparency. It suits flat areas and sharp content such as UI, text, diagrams and icons. JPG is lossy, meaning it discards detail the eye barely notices, which works well for photos but gives no transparency. WebP has both a lossy and a lossless mode, with transparency in either, and the author calls it the first format to reach for in most web delivery.
The author boils the choice down to three questions. Does the image need transparency? If so, JPG is out. Is it a photo or a graphic? Photos suit JPG or lossy WebP, while screenshots, logos and charts suit PNG or lossless WebP. Where does the image end up? If an upload form or older CMS only accepts JPG, convert it and move on.
The post also covers converting PNG to JPG. Transparent areas get flattened onto a solid background, usually white. For photos, a quality setting of around 85 to 90 is described as the usual sweet spot, while going below about 70 can show blocky artifacts. Each lossy re-save adds more damage, so the author advises keeping the lossless original and exporting from it. The article closes by suggesting a measurement loop: test representative images, compare encoded size, check visual differences and look at the effect on Largest Contentful Paint (LCP), the time the main content takes to appear.
Why it matters
Image format is one of the easiest places to lose page speed or visual quality without noticing. A photo saved as PNG adds weight for no visible gain. A logo saved as JPG looks soft and may pick up a white box. These problems are cheap to avoid once you know what each format does well.
The article also warns against treating any one format as an automatic default. Testing your own images, rather than trusting a rule, shows whether a format change actually helps your pages.
Source: DEV Community. This brief summarises their reporting; read the original for the full detail.