Resize Image to Print Size
Operator: Abdulla Al Fahad. How tools are built and checked
A print order form asks for 15 × 10 cm. Your phone gives you a file that is 4000 × 3000 pixels and says nothing about centimetres. Between the two sits one number, the DPI, which says how many pixels are laid side by side along each inch of paper. Pick it, and the print size and the pixel size fix each other: 15 cm at 300 DPI is 1772 pixels, no more and no less.
This tool does that arithmetic and the resizing that follows. You choose centimetres or inches, type the width and height, and pick 72, 150, 300 or 600 DPI. The panel shows the exact pixel size before you download. The photo is then centre-cropped or fitted to that shape, saved as JPG or PNG, and the DPI is written into the file's header, so software that reads it knows the intended printed size.
Key features
- Width and height in centimetres or inches, with values converted when you switch units
- 72, 150, 300 or 600 DPI, with 300 selected by default
- Crop to fill (centred) or fit with a border in a colour you choose
- Exact pixel size shown before download, with a warning when the photo would be enlarged
- JPG at quality 92 with the DPI in the JFIF header, or PNG with the DPI in a pHYs chunk
- Photos turned upright from their EXIF rotation before resizing
- File name records the size and DPI, for example holiday-15x10cm-300dpi.jpg
Pixel counts and where the DPI is stored
Pixels are the printed length in inches multiplied by the DPI, rounded to a whole number. A centimetre length is divided by 2.54 first. So 10 cm at 300 DPI is 10 ÷ 2.54 × 300 = 1181.1, saved as 1181 pixels, and a 15 × 10 cm print at 300 DPI is 1772 × 1181 pixels. In inches the sums are rounder: 4 × 6 inches at 300 DPI is exactly 1200 × 1800.
A JPG stores its resolution in the JFIF APP0 segment at the start of the file: a unit byte set to 1 for dots per inch, followed by the horizontal and vertical density. If the browser's encoder wrote no JFIF segment, one is added straight after the start-of-image marker. A PNG stores resolution in a pHYs chunk measured in pixels per metre, so 300 DPI becomes 300 ÷ 0.0254 = 11811 pixels per metre. Any pHYs chunk already present is replaced rather than duplicated.
JPG files are saved at quality 92. PNG is lossless and keeps transparency when the crop mode is used; in fit mode, or when saving a JPG, the empty or transparent areas are filled with a solid colour, because a JPG has no transparency.
How it works
The photo is decoded once, upright according to its EXIF rotation, and a reduced copy of at most 1200 pixels on the long side is kept for the preview. Changing the size, DPI, mode or border colour redraws only that small copy; the full-resolution photo is touched again only when you click Download.
The target pixel size comes from the formula above. In crop mode the photo is scaled so that it covers the whole target and the overflow is cut equally from both sides; in fit mode it is scaled so that all of it fits and the remaining strips are filled with the border colour. Large reductions are made in halving steps, which keeps fine detail such as hair or text from turning jagged. The canvas is encoded as JPG or PNG, and the density fields are then written into the encoded bytes before the file is handed to your browser's download.
Common use cases
- Someone orders 15 × 10 cm prints from a photo lab that asks for files at 300 DPI and the exact pixel size.
- A student needs a picture at 8 × 10 inches for a poster board and wants to know whether the phone photo has enough pixels before paying for the print.
- A crafter prints a design onto A6 card at home and wants it to come out 10.5 × 14.8 cm with the printer set to actual size.
- A small shop prepares a product photo for a flyer layout that needs a 9 × 6 cm image at 300 DPI.
- A grandparent wants a square 20 × 20 cm print of a landscape photo and needs to see how much the square crop cuts off each side.
How to use this tool
- Drop a JPG, PNG or WEBP photo onto the box, or click it to choose one.
- Choose centimetres or inches.
- Type the print width and height. Use the swap button if the print should face the other way.
- Choose the DPI the printer asks for, or keep 300.
- Choose crop to fill or fit with border, and a border colour if you fit.
- Check the pixel size and any warning under the preview.
- Choose JPG or PNG and click Download.
Example
Photo and settings
A 4000 × 3000 px phone photo, 15 × 10 cm, 300 DPI, crop to fill, JPGResult
A 1772 × 1181 px JPG with its JFIF density set to 300 × 300 dots per inch. The photo is 4:3 and the print is 3:2, so about 334 pixel rows are trimmed from the top and bottom together, 11% of the picture. The photo is reduced to 44% of its size, so it carries about 677 DPI worth of detail and no enlargement warning appears. In fit mode the same photo would become a 1575 × 1181 picture with a border of about 98 px on the left and on the right.Tips for best results
- Start from the camera original, not a copy saved from a chat app or social network. Those copies are often reduced to around 1600 pixels on the long side, which is not enough for a sharp 15 × 10 cm print at 300 DPI.
- Match the print's orientation to the photo. A landscape photo cropped to a portrait 10 × 15 cm print loses half its width; the swap button between width and height turns the print around.
- Choose fit with a white border when nothing at the edges may be cut off, such as a group photo with people at both ends.
- Pick 300 DPI unless the printer asks for something else. 150 DPI is enough for large posters seen from a distance, and 600 DPI mainly makes sense for line art and small text.
- Print with scaling switched off, labelled Actual size, 100% or None in most print dialogs, or the printer will shrink or stretch the image to fill the page.
Edge cases to watch
Setting the DPI does not add detail. When the photo has fewer pixels than the print needs, it is enlarged, and the amber warning tells you the resolution the photo really gives at that size. A 1600 × 1200 picture cropped to 15 × 10 cm at 300 DPI gives only about 271 DPI of real detail, and at 30 × 20 cm about 135 DPI.
Some programs ignore the DPI in the header. Many photo labs and print dialogs use it to set the printed size, but some apps simply place the image at a default size, and most web uploads strip or ignore it. The pixel size is what is fixed; the DPI field is a hint to the software that opens the file.
Large prints at high DPI hit the size limit. A3 at 600 DPI would be 7016 × 9921 pixels, nearly 70 megapixels, which is over the 50-megapixel limit for one file here and beyond what many browsers can draw on a canvas. Lower the DPI to 300 for a print that size.
Rounding can make a tiny difference to the physical size. Because pixels are whole numbers, 1181 pixels at 300 DPI print as 9.999 cm rather than exactly 10 cm. That fraction is far smaller than what a printer may crop off the edge or add as its own margin, so check the lab's bleed and margin rules when the edges matter. It is also why the pixel numbers in two tools can differ by one.
The saved file is redrawn from a canvas, so the camera's EXIF data, including the date taken, the camera model and any GPS location, is not copied across. Keep the original if you need those details.
Colour profiles are not carried over either. A photo tagged with a wide-gamut profile is converted by the browser and saved without the profile, which can make strongly saturated colours print slightly differently.
Common errors and how to fix them
- The size is over the 50-megapixel limit for one file.
- Lower the DPI or the print size. For prints larger than A4, 300 DPI or even 150 DPI is usually plenty, because large prints are seen from further away.
- The Download button stays greyed out after a photo is chosen.
- The width or the height is empty, out of range or not a number, or the pixel size is over the limit. The message under the size fields or under the preview names which one; fix it and the button comes back.
- The print size field shows an error.
- Type a plain number, with a point or a comma for decimals. Lengths run from 0.5 to 152.4 cm, or 0.2 to 60 inches; both ranges are the same physical span, so switching units keeps a valid size valid.
- The printed picture comes out the wrong size.
- The print dialog is probably set to fit the page. Choose Actual size or 100%, and check that the paper size in the dialog matches the paper in the printer.
Best practices
- Look at the effective DPI in the warning before ordering a large print. A figure well below the DPI you chose means the print will show less detail than the file's pixel count suggests.
- Keep the original file and work from it each time. Resizing an already resized file loses detail with every pass.
- Save PNG for graphics with flat colours, text or transparency, and JPG for photographs, where the file is much smaller.
- Order one test print before a batch when colour or exact size matters.
What DPI actually changes
DPI only links pixels to paper. The same 1772 × 1181 file is a 15 × 10 cm print at 300 DPI, a 30 × 20 cm print at 150 DPI and a 7.5 × 5 cm print at 600 DPI. Changing the number in the header without changing the pixels leaves the picture identical on screen and changes only the size a print program will choose for it.
That is why this tool always resizes the pixels as well as setting the field. Typing 15 × 10 cm at 300 DPI produces a file with exactly the pixels a 300 DPI print of that size needs, so the result is right whether the printing software reads the header or you tell it the size yourself.
Crop or fit: deciding what to lose
When the photo and the print have different shapes, something has to give. Crop keeps the print completely filled and cuts the photo; fit keeps the whole photo and leaves bands of colour. A typical phone photo is 4:3, while the classic 15 × 10 cm and 6 × 4 inch prints are 3:2, so crop removes about 11% of the picture and fit leaves narrow side borders.
The crop is always centred. If the subject is near an edge, it is safer to crop the photo yourself first, to the right proportions, and then use this tool only to set the size and DPI. The preview shows exactly what the saved file will contain.
Inches, centimetres and the 2.54 that joins them
DPI is defined per inch even in countries that measure paper in centimetres, so every metric size goes through the factor 2.54. Switching the unit converts the numbers you typed and rounds them to two decimals: 10 cm becomes 3.94 inches. A conversion back and forth can drift in the second decimal place, so type the size again in the unit the printer uses if exactness matters.
Frequently asked questions
How many pixels do I need for a 15 × 10 cm print?
1772 × 1181 at 300 DPI, 886 × 591 at 150 DPI and 3543 × 2362 at 600 DPI.
Can I make a low-resolution photo print sharply by setting 300 DPI?
No. The file will have the right pixel count, but the extra pixels are interpolated from the ones the photo had. The enlargement warning shows how much real detail is left at the size you chose.
Why is 72 DPI in the list?
Some forms and older layout templates ask for 72 DPI images. At 72 DPI, 10 cm is only 283 pixels, so it is meant for screen use, not for printing.
Which DPI does my file end up with if I upload it to a website?
Whatever the site decides. Many sites re-encode images and discard the header, so the DPI matters only for files that go to a printer or into a layout program.
Does the tool make the photo sharper or fix colours?
No. It resizes, crops or pads, and writes the DPI. Sharpening and colour correction are left to a photo editor.