Skip to content
UniKit

Edit image DPI

Inspect and change an image DPI metadata: read the current value, rewrite it to any target (JFIF density for JPEG, pHYs for PNG) and get the print size at that DPI.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Images are processed locally in your browser with Canvas and never uploaded.

Pick an image first (PNG / JPEG / WebP / GIF all work).

Result

No result yet

Result details

These are the real numbers from this run — copy them straight out.

Pick an image and set the options; sizes, pixel count and export size show up here.

What this tool does

  • Normalise DPI before submission: read what each file currently claims, then write a single target value so the print shop stops asking.
  • Debug "the print came out the wrong size": check the current DPI and the raw density field before deciding on a new value.
  • Export several DPI versions of one image and confirm the print size (pixels ÷ DPI) matches expectations.

Example

Input

A 4×4 PNG with no pHYs chunk, target DPI 300

Output

A pHYs chunk of 11811 pixels/metre (≈ 300 DPI) is written; the previous DPI reads "not set" and the new one reads 300

Straight from applyDpi and inspectDpi: dpiToPixelsPerMeter(300) = 11811 and reading it back gives ≈ 300, with the PNG unit field set to 1.

Frequently asked questions

Does changing DPI resample the image?

No. Only metadata segments or chunks are rewritten and pixel data is copied verbatim, so quality and pixel dimensions are unchanged and the file size moves by a few dozen bytes.

Why does it read "not set"?

That file has no usable density field (a PNG without pHYs, or a JPEG whose JFIF unit is not DPI). The DPI is then null, but the raw unit and value are still shown to help you diagnose it.

Can I set any value?

Any integer from 1 to 10000. Anything outside that range raises an error rather than being silently clamped.

Does it support WebP or GIF?

No, it raises unsupported-format. Those formats store DPI differently (RIFF extension chunks, pixel aspect ratio), and writing to them would corrupt the file.

Keywords:png physedit dpichange image dpiprint resolutionjfif density

Related tools