Convert image DPI and preserve print size
Changing an image’s DPI can mean two very different things: editing a metadata label or actually changing how many pixels are available for a fixed print.
Run — free
This calculator makes the second meaning explicit. Enter the current pixel width and height, the current DPI, and the target DPI. It first derives the physical width and height of the print, then calculates the pixel dimensions needed to preserve that exact physical size at the new density. The result gives you a clear specification for resampling, export settings, print preparation, or production handoff.
Understand the relationship between pixels, DPI, and print size
An image does not have an absolute printed size until a pixel density is chosen. The physical width in inches is the pixel width divided by the current DPI, and the physical height follows the same rule. For example, a 2400 by 3000 pixel image interpreted at 300 DPI occupies 8 by 10 inches. This capability performs that calculation independently for both axes and also reports centimeters for convenient production planning. DPI is used here as the familiar print-workflow term for pixels per inch; no assumption is made about printer dot patterns, ink screening, or device-specific output resolution. The distinction matters because merely changing a DPI metadata tag does not create additional image detail. By exposing the physical dimensions before calculating anything new, the result lets you verify the intended print size and catch incorrect source metadata early. Both pixel dimensions and DPI values must be positive finite numbers, because zero, negative, infinite, or missing values cannot describe a usable raster image or physical print.
Convert to a target DPI while preserving the physical dimensions
Once the physical width and height are known, the required target pixel dimensions are found by multiplying each size in inches by the target DPI. Raising the density therefore increases the requested pixel grid, while lowering it decreases the grid, but the nominal print size remains unchanged. The calculator rounds each resulting dimension to the nearest whole pixel because raster files cannot contain fractional pixels. That rounding can introduce a tiny difference of less than half a target pixel compared with the mathematical ideal, which is normally far below any visible or measurable print tolerance. The response also includes a scale factor equal to target DPI divided by current DPI. A factor of 2 means each linear dimension doubles and the total pixel count becomes roughly four times larger; a factor of 0.5 means each linear dimension is halved. Use these target dimensions in an image editor’s resampling or export dialog when you truly need a new pixel grid. If you only need to correct metadata, preserve the original pixels instead.
Use the result responsibly in a print workflow
The calculation tells you the dimensions required for a chosen density, but it cannot invent genuine detail that the source never captured. Upsampling a small image to a much higher DPI creates more pixels through interpolation, not new texture, sharper focus, or additional subject information. Treat the target dimensions as a production requirement and compare them with the source before deciding whether resampling is sensible. For photographs, a moderate reduction may be appropriate for a larger viewing distance, while fine art, small text, line drawings, and close inspection can justify a higher target density. Keep an untouched master file, work from the best available source, and inspect the resampled output at meaningful zoom levels before sending it to a printer. Also confirm that the print provider uses the same intended trim size and does not add bleed, borders, or cropping after this calculation. Those layout changes alter the required canvas dimensions and should be accounted for separately. The API price is $0.002 per request, and the same deterministic arithmetic produces the same result for identical inputs.
What you can do with it
Prepare a photo for a fixed-size print
Translate an existing image’s dimensions into the exact pixel grid requested by a lab at its preferred DPI.
Plan a resampling workflow
See the linear scale factor and target dimensions before choosing an interpolation method in an image editor.
Validate artwork from a contributor
Confirm the physical size implied by supplied pixels and current DPI, then compare it with production requirements.
FAQ
Does changing DPI improve image quality?
No. A higher target DPI can require more pixels, but interpolation cannot recreate detail absent from the source.
Why are target pixel dimensions rounded?
Raster images require whole pixels, so each mathematical target dimension is rounded to the nearest integer.
Does the physical print size change?
No. The capability calculates target pixels specifically to preserve the physical size implied by the current pixels and DPI.
Are DPI and PPI the same?
This calculation uses DPI in the common image-workflow sense of pixels per inch. Actual printer dots and screening are device-specific.
What happens if a DPI is zero or negative?
The request fails with an invalid input error because physical size and density conversion require positive DPI values.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/image/dpi-convert \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"width_px":2400,"height_px":3000,"current_dpi":300,"target_dpi":150}'const res = await fetch("https://api.kit.forhosting.com/image/dpi-convert", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"width_px": 2400,
"height_px": 3000,
"current_dpi": 300,
"target_dpi": 150
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/image/dpi-convert",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"width_px": 2400,
"height_px": 3000,
"current_dpi": 300,
"target_dpi": 150
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/image/dpi-convert", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"width_px":2400,"height_px":3000,"current_dpi":300,"target_dpi":150}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"width_px":2400,"height_px":3000,"current_dpi":300,"target_dpi":150}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/image/dpi-convert", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"width_px": 2400,
"height_px": 3000,
"current_dpi": 300,
"target_dpi": 150
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "image.dpi_convert",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_mb | 15 |
max_megapixels | 12 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |