Pixels, DPI, alpha channels, and chroma subsampling: technical guide to JPG, PNG, and WebP conversion
What happens inside HTML Canvas during downscaling, why transparent PNG pixels turn white in JPEG, how lossy quality curves behave, and why DPI tags do not change web file size.
Resizing or converting an image sounds simple until a transparent logo suddenly turns solid white in JPEG, a sharp screenshot looks blurry after scaling, or an upload portal rejects a file even though you lowered the "DPI" setting in another app. Knowing how browsers decode bitmaps, resample pixels, handle alpha transparency, and encode JPG, PNG, and WebP inside Image Studio eliminates guesswork.
1. Pixel dimensions vs DPI: why portals only care about pixels and bytes
Digital images are grids of pixels (for example, 1200 x 800 px). The DPI or PPI value stored inside a file header is merely a print-scale hint telling printers how tightly to pack those pixels on paper. Changing a metadata header from 300 DPI to 72 DPI without changing pixel count leaves the image identical in pixel dimensions and almost identical in file size.
To meaningfully reduce upload weight, you must change either the pixel dimensions (width and height), the encoding format, or the lossy compression quality. Cutting both width and height in half (50% scale) reduces total pixels by 75% (from 4 million pixels down to 1 million), which immediately produces a dramatic drop in file size.
2. How JPG, PNG, and WebP encode pixels differently
Every export format in Image Studio uses a fundamentally different compression strategy:
| Format | Compression type | Alpha transparency | Technical sweet spot |
|---|---|---|---|
| JPEG (.jpg) | Lossy DCT blocks + chroma subsampling (typically 4:2:0) | Not supported; transparent pixels flatten onto solid white | Photographs, camera scans, portraits, and strict KB upload limits |
| PNG (.png) | Lossless DEFLATE filtering | Full 8-bit alpha channel (256 transparency levels) | UI screenshots, text graphics, logos, and assets needing sharp edges |
| WebP (.webp) | Modern predictive lossy or lossless encoding | Full alpha channel supported alongside high compression | Websites, blogs, and modern uploads needing 25% to 35% smaller files than JPG |
3. What happens during Canvas resampling and cropping
Inside Image Studio, edits run on a local 2D HTML Canvas buffer rather than a remote server. When you resize an image downward, the browser's high-quality resampling filter blends neighboring source pixels to prevent jagged aliasing lines along diagonal edges. Locking the aspect ratio keeps horizontal and vertical scale factors identical so portraits never look stretched or squished.
Cropping slices an exact integer rectangle (left, top, width, height in whole pixels) before export, guaranteeing zero sub-pixel blur. Because Image Studio keeps a local history stack, you can crop, rotate 90 degrees, flip, and resize in sequence while using Undo and Redo freely before encoding the final file.
4. Alpha flattening and quality curve traps to avoid
- Why transparent PNGs get a white background in JPEG: JPEG files store only three color channels (Y, Cb, Cr) with no transparency channel. If you convert a transparent logo without compositing a background first, raw undefined pixels can turn black. Image Studio explicitly composites transparent areas onto clean white when JPEG is selected.
- Avoid quality 100% in JPEG: Moving JPEG quality from 92% to 100% frequently doubles the file size with virtually zero visible difference to human eyes. Between 78% and 88% is the sweet spot for almost all web photos.
- Do not repeatedly re-save JPEGs: Each lossy save re-quantizes 8x8 pixel blocks, compounding artifacts. Finish cropping, rotating, and resizing in one session, then download once.
- Watch EXIF metadata stripping: Re-encoding through browser Canvas automatically strips hidden GPS coordinates, camera serial numbers, and EXIF rotation quirks, normalizing the image upright for every viewer.
Trying to pass a strict 200 KB or 1 MB portal form right now? Follow our practical workflow inHow to resize and compress photos to meet upload limits, or open Image Studio to test formats side by side.