DIP : How To Calculate Megapixel Of The Camera From Its Captured Image File ?

Abhishek Rawal

Abhishek Rawal

@abhishek-fg9tRh Oct 22, 2024
So, let's say i have a file of 14.5 MB & resolution of 4243 x 2828. I don't know the model number of the camera being used. And I want to find the MegaPixel of the camera with mathematical calculation. How that can be done ?

I know it is possible to calculate Megapixel by knowing two parameters i.e total image size & resolution, but how ?
Anyone ?
(Or is it possible to know megapixel of camera by mere one parameter, resolution ? )

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Apurwa.Thakur

    Apurwa.Thakur

    @apurwathakur-8cwdkc Jul 10, 2013

    Abhishek Rawal
    So, let's say i have a file of 14.5 MB & resolution of 4243 x 2828. I don't know the model number of the camera being used. And I want to find the MegaPixel of the camera with mathematical calculation. How that can be done ?

    I know it is possible to calculate Megapixel by knowing two parameters i.e total image size & resolution, but how ?
    Anyone ?
    (Or is it possible to know megapixel of camera by mere one parameter, resolution ? )
    hello,
    A megapixel is a rounded number found by multiplying the total number of horizontal pixels by the total number of vertical pixels.
    4243 x 2828=11999204
    1 megapixel =1,000,000
    Now might this camera is of 11 megapixel .m nt sre. I am not sure (Edited)
  • Abhishek Rawal

    Abhishek Rawal

    @abhishek-fg9tRh Jul 10, 2013

    Apurwa.Thakur
    hello,
    A megapixel is a rounded number found by multiplying the total number of horizontal pixels by the total number of vertical pixels.
    4243 x 2828=11999204
    1 megapixel =1,000,000
    Now might this camera is of 11 megapixel .m nt sre. I am not sure (Edited)
    Thanks Apurwa.
    I just googled & found 1 MP = 10^6 pixels.You're right.

    So one more question,
    From only one parameter i.e Total number of pixels, Can we calculate memory of the picture ?
    If yes,then how ?

    Every pixel contain specific amount of memory ? How much ?
  • lal

    lal

    @lal-R60Xjx Jul 10, 2013

    It isn't just the resolution that defines the space occupied by a picture. It depends on the detail each pixel contains too. Now, detail is dependent on the light, say brightness.

    For instance a very dark image uses less memory when compared to a picture at right exposure though both are shot with the same camera at exactly same resolution.
  • Ashraf HZ

    Ashraf HZ

    @Ash Jul 10, 2013

    lal
    It isn't just the resolution that defines the space occupied by a picture. It depends on the detail each pixel contains too. Now, detail is dependent on the light, say brightness.

    For instance a very dark image uses less memory when compared to a picture at right exposure though both are shot with the same camera at exactly same resolution.
    Yes, the colour depth. Just to add regarding file size, you also need to consider image compression techniques used (lossless vs lossy).

    Disregarding compression techniques (we'll pick BMP format), you can estimate the file size from the color depth profile as well.

    Say, monochrome photos are represented by 1 bit per pixel x width x height. Divide by 8 to get bytes.

    So for 24 bits per pixel (2 power of 24 = 16777216 possible colours), you multiply accordingly.
  • Apurwa.Thakur

    Apurwa.Thakur

    @apurwathakur-8cwdkc Jul 10, 2013

    Abhishek Rawal
    Thanks Apurwa.
    I just googled & found 1 MP = 10^6 pixels.You're right.

    So one more question,
    From only one parameter i.e Total number of pixels, Can we calculate memory of the picture ?
    If yes,then how ?

    Every pixel contain specific amount of memory ? How much ?
    Here is explanation,check whether this is useful or not? 😕

    let scan resolution is 75 dpi(dot per inch)
    and image size is 6*4 inch
    then you can calculate pixel which is 450*300
    n pixel count is 135000

    now to calculate memory i think you should know type of

    image(RGB COLOR IMAGE,GRAY SCALE,LINE ART)

    1.for 24 bit rgb color
    memory size in byte is
    135000*3=405000 (24 bit=3 byte per pixel)

    2.for 8 bit gray scale
    memory size is 135000*1=135000(8 bit=1 byte)

    3.for line art
    mmory size is 135000/8=16,875( (contain 1/8 bit per pixel)
  • lal

    lal

    @lal-R60Xjx Jul 10, 2013

    By the way, you can always check the exif details of the picture to get the information about camera used and the method used for shooting. Provided the exif details weren't removed by any external software.

    By default all digital cameras write exif details to the pictures taken with them which include camera make and model, resolution, date, time, flash status, ISO, even focal length and more.
  • Anoop Kumar

    Anoop Kumar

    @anoop-kumar-GDGRCn Jul 10, 2013

    A megapixel is a rounded number found by multiplying the total number of horizontal pixels by the total number of vertical pixels.

    4243 x 2828=11999204
    1 megapixel =1,000,000

    Now might this camera is of 11 megapixel
    +1, simplest way to find camera megapixel.
    Picture of 4000*3000 resolution = 12MP (12,000,000).


    File size depends on DPI (Dots per inch) , color depth and compression mechanism.
    As you know RAW files always take lots of space, A 12MP camera generally takes 18mb RAW file which DPI(similar to jpg) and color depth (generally 8 bit or 16bit), here compression mechanism comes into picture as RAW files are uncompressed.

    But more DPI and Color depth means bigger file size.