# Why 1 megapixel is always 1024×1024?

A CCD can be square one or rectangular. And its size is represented by M×N. So for 1 megapixel there are 1024×1024 pixels. If it's square or rectangular it will be some multiple of this number. I want to know why this particular number and why we cannot simply use 1000×1000 pixels.

• Possible duplicate of How many pixels in a megapixel? Commented Mar 29, 2018 at 11:17
• You can not make a question affirming the wrong premise. Commented Mar 29, 2018 at 17:11

A megapixel is one million pixels. Mega is the SI-prefix for 106. If you arrange 1 million pixels in a square, it will be 1000x1000. But really it is just a count of the pixels, there's no connection to the physical layout.

You are probably confusing this with MegaByte from the computing world, where it means 220 bytes, ie. 10242, because computers like to count in powers of 2. (Actually, nowadays the MB was redefined as 106 so harddisk producers could boast bigger disks, and a new unit, the MebiByte & al., was introduced for the binary powers.)

What makes you think 1 megapixel corresponds to 1,048,576 pixels? Looking at the specifications for my camera that's just not true: it's advertised as a 20 MP camera, and effective image size (in raw) is 19,816,192 pixels (not 20,971,520 pixels). Camera makers have no reason to use 1k=1024, as it gives a lower value in their advertisements (taking my camera as an exemple again, those 19,816,192 pixels would correspond to 19 MP with 1k=1024, so 1MP less).

That 1k=1024 measure comes from computer science; and corresponds to 1k = 210, useful as an approximation to estimate what range is covered by a given number of bits.

The term megapixel is applied fairly imprecisely it's sort of like the "classes" in TV size. A 34" TV could actually be a 33.6" diagonal. Nobody really cares if their camera is 34.82MP or 34.9MP and the industry would just as soon create a "35MP class" and make their marketing materials easier to read.

The reason that many "1 megapixel" cameras are actually 1024x1024 is one of architecture. Information is often moved around inside the camera in "chunks" ranging from 16 pixels at a time to 256 pixels at a time in 16 pixel increments, where 64 is a common number. So if I had a camera that was 1000 pixels wide and went to read out one row 16 pixels at a time, I would need a way to tell the camera that those last 8 pixels (1000/16 is 62, remainder 8) pixels aren't missing but that they just don't exist. It's easier to size the sensor so that those pixels do exist.

Note that sometimes the manufacturer may make a 1000x1000px image from a 1 MP camera but chances are there are 24 buffer pixels in each direction that they simply crop out.