- A pixel is one dot of a digital image. A megapixel is a million pixels: it is the size of an image (12 megapixels = 4,000 × 3,000 pixels).
- The more pixels, the heavier the file: 12 megapixels weigh about 36 MB before compression. This is what Compress an image reduces.
- Dpi is the number of pixels per inch (2.54 cm). It only changes the size of the image on paper, never its weight: pixels ÷ dpi.
- To show an image on a screen, only the pixels count. Dpi only matters for printing or scanning.
The pixel: the smallest dot of an image
A digital image is a grid of small squares of colour. Each square is a pixel, from “picture element”. The more pixels, the more detail the image can show.
Choose a number of pixels: you will see the FileDiet logo drawn with less and less detail.
16 × 16 = 256 pixels: the image is drawn with 256 small squares.
With 8 × 8 pixels, you can barely make out a blue shape. With 256 × 256, the logo becomes sharp: the pixels are so small that you can no longer see them.
Each pixel carries information. That is why an image with many pixels is a heavy file: we come back to this below.
The megapixel: how many pixels in total
To count the pixels of an image, multiply its width by its height, both in pixels. A megapixel is one million pixels: “mega” means million.
Choose an image to see the calculation.
- Width4,000 pixels
The number of pixels across the width of the image.
- Height3,000 pixels
The number of pixels along the height of the image.
- width × heightTotal pixels12,000,000 pixels
12 Mpx photo: 4,000 × 3,000 = 12,000,000 pixels.
- ÷ 1,000,000In megapixels12 megapixels
A megapixel is one million pixels: “mega” means million. 12,000,000 ÷ 1,000,000 = 12.
- × 3 bytesIn file size36 MB
A colour pixel takes 3 bytes: one for red, one for green, one for blue. 12,000,000 × 3 = 36,000,000 bytes, or 36 MB before compression.
A Full HD screen shows 2.1 million pixels, a 4K screen about 8.3 million. A 12-megapixel photo therefore has more pixels than a 4K screen can show: on screen, the extra pixels are not visible, but they make the file heavier.
Why more pixels means more weight
Each pixel is described by information. You have just seen it: in colour, it takes 3 bytes before compression, so a 12-megapixel photo weighs about 36 MB. The JPG format compresses it, but the principle stays: more pixels, more data, so a heavier file. A byte is a group of 8 bits (see Audio bitrate: 64, 128 or 320 kbit/s?).
This is where FileDiet comes in: Compress an image makes your photo lighter without you having to set anything. Here is how it works:
Dpi: how many pixels per inch
What is dpi for? It links pixels to the real size on paper. It tells you how large you can print a photo before it turns blurry, and it is also the setting of a scan.
Dpi stands for “dots per inch” and tells you how many pixels fit in 1 inch when you print or scan. An inch is an imperial unit of length: 1 inch = 2.54 cm.
Where do you see this number?
Example: an iPhone photo on paper
Take an iPhone photo: about 4,000 × 3,000 pixels (12 megapixels). In software, the “Resolution” line sets the print size: the more pixels per inch, the tighter they are packed, and the smaller the photo. Choose a dpi to see it.
- The pixels of the photo4,000 × 3,000 pixels
An iPhone photo. This number never changes, whatever the dpi.
- ÷ 300In inches13.33 × 10.00 inches
Each inch holds 300 pixels. 4,000 ÷ 300 = 13.33 inches wide and 3,000 ÷ 300 = 10.00 inches high.
- × 2.54In centimetres33.9 × 25.4 cm
1 inch = 2.54 cm. 13.33 × 2.54 = 33.9 cm and 10.00 × 2.54 = 25.4 cm.
Blue rectangle: the photo printed at 300 dpi. Dotted outline: an A4 sheet (21 × 29.7 cm).
The three words at a glance
| Word | What it is | Example | Effect on file weight |
|---|---|---|---|
| Pixel | One dot of an image | 1 dot of a photo | Each pixel adds information: the more there are, the heavier the file |
| Megapixel | The total number of pixels, in millions | 12 megapixels = 4,000 × 3,000 pixels | 12 megapixels weigh about 36 MB before compression |
| dpi | The number of pixels per inch, when printing or scanning | 300 dpi | None: changing the dpi does not make a file lighter |
Remember this: pixels decide the amount of detail and the weight, dpi decides the size on paper.
1See the dimensions of a photo
Multiply the width by the height, then divide by 1,000,000: you get the megapixels.
2Make a heavy image lighter
- Open Compress an image and drop your photo.
- Look at the weight before and after, then download the result.
- To aim for a precise size, for example for a form, use Image to a precise size.
Frequently asked questions
What is a pixel?
A pixel is the smallest dot of a digital image: a small square of a single colour. An image contains thousands or millions of them, side by side.
How many pixels are in a megapixel?
One million. To find the megapixels of an image, multiply its width by its height, in pixels, then divide by 1,000,000. An image of 4,000 × 3,000 pixels is 12 megapixels.
What is the difference between pixels and dpi?
Pixels are the dots of the image. Dpi says how many of these dots fit in 1 inch when you print or scan. Dpi does not change the number of pixels: it only changes the size of the image on paper.
Does changing the dpi make an image lighter?
No. Dpi is an indication for printing: it changes neither the number of pixels nor the file weight. To make an image lighter, reduce its weight with Compress an image.
How do I make a photo lighter without losing sharpness?
Drop it into Compress an image: it first keeps all the pixels and lowers the JPG quality a little, which the eye barely notices. To aim for a precise weight, for example for a form, use Image to a precise size.
Does dpi change anything on screen?
No. On screen, only the pixels count. The dpi stored in a file is just an indication for printing.
How many megapixels do I need?
To look at an image on screen, 2 to 8 megapixels are enough: a Full HD screen shows 2.1 and a 4K screen about 8.3. More pixels mainly help for cropping or printing large.
Do more megapixels mean a better photo?
Not necessarily. Megapixels measure the size of the image, not its quality: light, lens and sensor matter just as much. More pixels mostly give a heavier file.
Why is my photo less sharp when I print it large?
The larger the image on paper, the lower the dpi: the same pixels are stretched. At 150 dpi, a 12-megapixel photo covers about 68 × 51 cm; beyond that, it will look less sharp.
Does FileDiet send my images to a server?
No. Images are processed in your browser, on your device. Nothing is sent or saved. The How it works page explains how to check it.
Sources
- CSS Values and Units: the dpi unit and the 2.54 cm inch (W3C)
- Exif: file format of digital cameras (CIPA)
- SI prefixes: kilo, mega… (BIPM)