Most web tools "convert to 300 DPI" by redrawing the image onto an HTML5 <canvas> and re-encoding it — which silently triggers JPEG lossy recompression and degrades print sharpness.
Instead, DPI in standard image files is purely a metadata header:
- JPEG (
JFIF APP0): Bytes inside theFF E0marker segment defineunits(1= dots per inch) andXdensity/Ydensityas 16-bit big-endian integers (0x012C= 300). - PNG (
pHYschunk): Stores Pixels Per Unit in pixels per meter (Math.round(300 / 0.0254) = 11811) plus a recalculated CRC32 checksum.
By reading and patching these binary segments directly with JavaScript Uint8Array slices, you get true lossless 300 DPI output in milliseconds without touching a single pixel.
Live Tools Built With This Browser-First Approach
- Lossless 300 DPI Print Studio: Change Image DPI Studio (includes JFIF/pHYs hex inspector, 2.5x loupe, and batch ZIP export)
- 2D Game Dev Tooling: Sprite Sheet Cutter & Animator (grid/tile slicer with live FPS preview + Godot/Unity JSON export)
- Drop-in Site Widget: Embeddable Image Resizer Widget (
<script>and<iframe>embed for blogs and apps)
Happy to answer questions about binary chunk parsing in client-side JS!``