How to load binary image with 1 Bit Per Pixel ?

G

Guest

Hi Everyone,

I have a TIF file 62992 x 113386 Pixels, Huffman RLE compression, 3200 x
3200 DPI resolution, binary colored (1 Bit Per Pixel), file on disk size
43.08 MB (45,169,042 Bytes).
This kind of image should consume 851.66 MB (893,028,184 Bytes) of memory
when loaded, and this is exactly what I want it to consume. Otherwise; the
representation per pixel will be 1 byte (8 Bits), which means that this kind
of image require 6.652 GB (7,142,410,912 Bytes) that I absolutely can not
have in any possible way.

Therefore I need to load this image as a binary image (1 Bit Per Pixel).

Can anybody tell me how can I do that please.
 
J

Jeffrey Tan[MSFT]

Hi Sharon,

We are currently doing research on this issue, we will reply to you ASAP.
Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

Hi,

I found that the Bitmap object can hold 1 bit per pixel, but for some
reason, that I can not understand, it consume twice the memory it should (not
8 times).

The image I'm loading is the one I mentioned in my initial post.

Other programs, like the IrfanView (http://www.irfanview.com/) and a project
at http://www.codeproject.com/bitmap/graphicsuite.asp are loading this same
image with the exact memory.

Can you tell why the Bitmap object take twice the memory in cases like this?
 
G

Guest

Some more info that I found:

When loading the image to a Bitmap object, it throws en exception saying
"Bad argument".
And if I load the image using Image.FromFile(imageFilePath) it throw en
exception saying "Out Of Memory" and it's because it consume twice the memory
it should (not 8 times).

The image I'm loading is the one I mentioned in my initial post.

Other programs, like the IrfanView (http://www.irfanview.com/) and a project
at http://www.codeproject.com/bitmap/graphicsuite.asp are loading this same
image with the exact memory.

Can you tell why the Bitmap throw the "Bad argument" exception and why the
Image.FromFile() take twice the memory in cases like this?
 
K

Kevin Yu [MSFT]

Hi Sharon,

Based on my research, this issue has something to do with a known issue in
GDI+. Could you please check if this only happens on this TIF file? If you
use a BMP. Will this also happen? In this case, I suggest you try to
contact Microsoft PSS directly for a confirm on this issue. If it is really
a bug, this case will be free of charge. You can find their contact
information from the following link:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;OfferProPhone

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top