Image size is the width and height of a picture, counted in pixels. In a metadata report, the Image Size field shows both numbers together, for example 1024x981. The first number is the image width, and the second number is the image height.
Image size is not the same as file size. Image size counts the pixels in the picture. File size counts the bytes in the file.
Which files carry it
Image formats store the width and height of the picture, and each format keeps the 2 numbers in its own place. A JPEG file stores them in its Start Of Frame segment.
A PNG file stores the width and height in its first chunk, which is called IHDR. GIF and WebP files keep the 2 numbers near the start of the file.
Videos have an image size too. In MP4 and MOV files, the track header stores the width and height of the video track. The ffprobe program also reports a width and a height for each video stream.
Where the value comes from
Image Size is usually not a field inside the file. The metadata reader ExifTool calculates Image Size after it has read all other metadata. ExifTool usually takes the Image Width and Image Height fields and joins them into one value. For Canon CR2 raw files, it uses the Exif Image Width and Exif Image Height fields instead.
Photos from cameras can also carry EXIF fields for the size. The Exif standard calls them ImageWidth (0x0100) and ImageLength (0x0101) for uncompressed images.
For compressed images such as JPEG, the standard uses PixelXDimension (0xA002) and PixelYDimension (0xA003) instead. ExifTool shows PixelXDimension and PixelYDimension as Exif Image Width and Exif Image Height.
What the value looks like
Image Size shows 2 whole numbers with a lowercase letter x between them. The width always comes first. In the raw value from ExifTool, a space separates the 2 numbers instead, as in 1024 981.
The value 1024x981 tells you the following about the picture:
- The image width is 1024 pixels.
- The image height is 981 pixels.
- The picture has 1024 times 981 pixels, which is 1,004,544 pixels in total.
- That is about 1.0 megapixels, because one megapixel is 1,000,000 pixels.
Why the width and height can look swapped
A picture can be stored in one position and shown in another. The Exif Orientation field tells a viewer how to turn the stored picture before the viewer shows it.
When Orientation is 5, 6, 7, or 8, the rows of the stored picture become columns on the screen. The width you see is then the stored height, and the height you see is the stored width. Image Size reports the stored numbers, so a photo that you see in portrait position can show a landscape size.
Why it matters
Image size tells you how many pixels you have to work with. For printing, the X Resolution field gives the number of pixels per inch or per centimetre. The width in pixels divided by that number gives the print width in that unit.
For example, a picture 1024 pixels wide, printed at 300 pixels per inch, is about 3.4 inches wide. That is about 8.7 cm.
Image size also matters on websites. When a web page gives the width and height of an image, the browser can reserve space before the image loads. The page then moves less, or not at all, when the picture appears.
Image size is not the only thing that decides file size. Compression also decides how many bits each pixel uses, and the Exif field CompressedBitsPerPixel records this compression mode in bits per pixel. So 2 pictures with the same image size can have different file sizes when they use different compression.