How Can I Convert Raw Pixel Count to File Size?

Discussion in 'Digital Photography' started by One4All, Sep 6, 2007.

  1. One4All

    One4All Guest

    Final print dimensions possible from a file depend, of course, on the
    file's size. I've run across info as to the pixel dimensions of a
    photo needed for various print sizes. I've also run across minimum
    file sizes for various print sizes. So, what's the problem? I want to
    be able to determine the print sizes possible from a variety of pixel
    dimensions of my photos, as my photos vary from the standards as to
    pixel dimensions and file size for standard print sizes.

    I have PS CS, and it gives me info re: all this, but I'd like to know,
    just from seeing the initial file size of the scanned or captured
    image, what I can expect re: print size before I get into PS, if that
    makes any sense. Well, it actually comes into play at the time you
    select a digital camera, and in this sense, the more resolution, the
    better.

    If nothing else, I'd like to know how the 2640x3296 pixel dimensions
    PS tells me about a photo translates to its 49.8 MB file size. (This
    is a scanned 35-mm photo.) Multiply the two dimensions to get the
    total pixel count. Then, I think the pixels have to be converted to
    bytes (divide by 8) then converted to 3 channels (times 3), but it's
    not working out.

    It's simple arithmetic, I know, but "simple arithmetic" for me is an
    oxymoron. :)
     
    One4All, Sep 6, 2007
    #1
    1. Advertisements

  2. One4All

    Jim Guest

    The print dimensions depend on the size of the image in pixels and the
    number of pixels per inch that you believe is best.
    The file size of an uncompressed file can allow a person to compute the size
    of the image in pixels.
    The file size of a compressed file allows no such computation.
    Jim
     
    Jim, Sep 7, 2007
    #2
    1. Advertisements

  3. One4All

    Marty Fremen Guest

    Each colour channel will normally have 8 bits, 24 bits for three channels,
    which is 3 bytes per pixel. So you multiply the height and width by 3.

    In your case it seems the scan is in 48 bit colour though (16 bits per
    channel) since the file is twice as big as would be expected for 24 bit
    colour. This is not unusual from a scanner (though in practice many of the
    extra bits will just be noise, it's unlikely that a scanner's sensor and
    A/D converter will achieve much more than 10-12 usable bits of
    picture information per channel).
     
    Marty Fremen, Sep 7, 2007
    #3
  4. One4All

    Roy G Guest

    It is simple arithmetic, your computer should be able to put a calculator on
    screen.

    Then 2640 X 3296 = 8,701,440.

    3 Colour channels means 3 X 8701440 = 26,104,320 if you scnned in 8 bit mode
    or double that if you were in 16 bit mode. That gives an answer very close
    to your 49.8 Mb file size. ( I am not going to get into the 1024 or 1000
    bits per K , cos near enough will do).

    The size of print possible depends on a lot more than just the pixel count,
    or PPI.

    Roy G
     
    Roy G, Sep 7, 2007
    #4
  5. One4All

    cmyk Guest

    Hi One4All,

    There is no fixed relationship between the number of pixels in a digital image and the size of the print that can be made from it,
    regardless of the printer resolution. That's because the image data can be rescaled on its way to the printer.

    Having made that point, the optimum results are obtained when the image resolution is an exact multiple of the number of dots to be
    printed. Taking your image dimensions (2640x3296) as a reference point, and a printer with a native resolution of 1440dpi, you could
    print images of 1.833in*2.289in, 3.667in*4.578in or 7.333in*9.156in without any degradation caused by a mismatch between the input
    pixels and output dots. You could also print the image at 10in*8in, but that translates into about 329.75dpi, which your printer is
    unlikely to be able to match, so some interpolation will be needed. In this case, you might get better results printing at 300dpi
    (for an 8.8in*11in print) on a printer that has a native resolution that is a multiple of 300dpi and leaving the print that size -
    or you could crop it before/after printing.

    Cheers
     
    cmyk, Sep 7, 2007
    #5
  6. Depends on which file type. .bmp is the most straightforward, but
    still difficult. For one thing there is the header, which on some
    file types is quite large. Then, many file types DO do various types
    of compression. JPEG in particular will NOT give a simple relationship
    between pixels and file size because it is an adaptive compression
    type- the amount of compression depends on the scene. Even lossless
    compression schemes such as used in TIFF have no simple math formula
    for this relationship. Other schemes do. In some the number of
    pixels remains the same and there is some "bit-packing" that
    determines the number of bytes per pixel (and then you add the header
    size).
     
    Don Stauffer in Minnesota, Sep 7, 2007
    #6
  7. One4All

    One4All Guest

    Jim,

    Thanks for your response. Except for your comment that a compressed
    file cannot be computed, your info is too general. I already know
    this. Thanks, anyway.
     
    One4All, Sep 9, 2007
    #7
  8. One4All

    One4All Guest

    This solves my confusion about converting to bytes. Multiplying by 3
    assumes the conversion. No separate conversion to 8 bytes is needed.
    Thanks. BTW, I should have said it was a scanned 35-mm *negative*, not
    a *photo*. I appreciate your ignoring the discrepancy.
    You're right. It is a 16-bit image. So, I need to multiply the result
    of times three by times 2. I get it.
     
    One4All, Sep 9, 2007
    #8
  9. One4All

    One4All Guest

    Thanks to all for their time & expertise in helping me resolve my
    issue. This is a great newsgroup!
     
    One4All, Sep 9, 2007
    #9
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.