Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8805699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:56:01+00:00 2026-06-14T01:56:01+00:00

I’m working on scanning application at a low level where I’m not very comfortable

  • 0

I’m working on scanning application at a low level where I’m not very comfortable already 🙂

Anyway, I’m trying to make sense out of numbers I’m getting.

Here we go:

  1. Scanning Letter size document with 200 DPI, B/W
  2. Resolutions comes up to 1700×2200
  3. I calculate 1700×2200 = 3740000 bits OR 467500 bytes
  4. When I get BITMAPINFOHEADER it says biSizeImage = 475200. WHY?
  5. Code snippet that I use to return byte array with BITMAP returns 475248 bytes which is 48 bytes more. But biSize says 40, so if header is 40, than why 48 bytes in front of image data?

Basically, I do not understand why difference between calculated 467500 and 475200 that’s in BITMAPHEADER?

I also do not understand why header says it is 40 bytes but in reality it is 48? I’m just guessing it’s 8 bytes for color infor? Because image is 2 color (B/W) – it uses 4 bytes per each color?

EDIT

Here is info:

enter image description here

I think I get it. When scanned line saved in memory it have to be in pack of 4 bytes.
So, according to my calculations 1700 bits is 212.5 bytes and according to what I see – it uses 216 bytes. So, it kind of makes sense.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:56:02+00:00Added an answer on June 14, 2026 at 1:56 am

    BITMAPINFOHEADER really is 40 bytes in size. Keep in mind that a bitmap is represented by a BITMAPINFO struct, not a BITMAPINFOHEADER struct by itself. BITMAPINFO contains an optional RGBQUAD color palette immediately after the BITMAPINFOHEADER struct.

    1700×2200 would be 3740000 pixels, which would take up 467500 bytes as the bitmap is using 1-bit pixels, ie it is a monochrome bitmap. Your bitmap has an extra 8 bytes in between the header and pixel data, with is consistent with a monochrome bitmap as the color palette would contain 2 RGBQUAD values. You have to take the BITMAPINFOHEADER::biBitCount field into account, as it tells you how many bits are actually used per pixel and how the color palette is used.

    The additional bytes are accounted for by each scanline being padded at the end to align on DWORD boundaries. biSizeImage is calculated in this situation as:

    biWidth = 1700
    biCount = 1
    biHeight = 2200
    biSizeImage = ((((((biWidth * biCount) + 31) / 32) * 32) / 8) * biHeight) = 475200
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group
I know there's a lot of other questions out there that deal with this
I need a function that will clean a strings' special characters. I do NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.