Thread: Representing greyscale images on monochrome (black and white) devices

  1. #1
    Registered User
    Join Date
    Nov 2015
    Posts
    54

    Representing greyscale images on monochrome (black and white) devices

    Hi!

    I am reading the article on BMP, and thus have a few questions
    that I post here today. I do hope to get help from you.

    Please, take a look at the quotation below. Do I understand correctly
    that 75DPI greyscale bitmap has 600 bits per inch (75DPI x 8 bits per
    inch in greayscale = 600 bits per inch), and 300 DPI of monochrome
    has only 300 bits per inch. Is it correct?
    If yes, then this means that the available capacity of this monochrome
    device is twice less than the given bmp image. Correct?

    As an example consider the problem of representing greyscale images on monochrome (black and white) devices. This is achieved by using a variable number of black and white pixels to represent a grey level. Fortunately the black and white device usually has much higher resolution than the bitmap so there are a number of pixels available to create the greyscale approximation. Consider a 75DPI greyscale bitmap to be displayed on a 300DPI black and white printer.
    Thank you!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    > Consider a 75DPI greyscale bitmap to be displayed on a 300DPI black and white printer.
    You seem to be confusing BPI with DPI

    I've never heard of "Bits Per Inch" as a useful measure of anything.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    There is nothing about the depth of the greyscale (e.g. 4-, 8- or 16-bit), and it doesn't matter here.

    The bitmap has 75 DPI. That means that each pixel represents 1/75th of an inch. Think about scanning in a 2x3" photo. Your resulting bitmap would be 150x225 pixels. Now, the printer, which is only black and white, is 300 DPI. So each little dot it can print is 1/300th of an inch. If you printed out 150x225 dots of ink on the printer, you would have something that is 0.5x0.75". Much smaller than the 2x3" you should see. To print out that same picture, at a size of 2x3", the printer needs to use several dots of ink per pixel. Specifically, 300/75 = 4 dots per pixel. That's one dimension though. Assuming your printer is 300x300 DPI, then each pixel from the image would be represented as a 2-D grid of 4x4 = 16 dots of ink. An all black pixel would be represented by having all 16 dots black. Turn a few of those dots white (i.e. don't print all 16 dots in that grid), and you have a simulated grey pixel.

  4. #4
    Registered User
    Join Date
    Nov 2015
    Posts
    54

    Making sure I understand plus clarification

    Quote Originally Posted by anduril462 View Post
    There is nothing about the depth of the greyscale (e.g. 4-, 8- or 16-bit), and it doesn't matter here.

    The bitmap has 75 DPI. That means that each pixel represents 1/75th of an inch. Think about scanning in a 2x3" photo. Your resulting bitmap would be 150x225 pixels. Now, the printer, which is only black and white, is 300 DPI. So each little dot it can print is 1/300th of an inch. If you printed out 150x225 dots of ink on the printer, you would have something that is 0.5x0.75". Much smaller than the 2x3" you should see. To print out that same picture, at a size of 2x3", the printer needs to use several dots of ink per pixel. Specifically, 300/75 = 4 dots per pixel. That's one dimension though. Assuming your printer is 300x300 DPI, then each pixel from the image would be represented as a 2-D grid of 4x4 = 16 dots of ink. An all black pixel would be represented by having all 16 dots black. Turn a few of those dots white (i.e. don't print all 16 dots in that grid), and you have a simulated grey pixel.
    Thank you so much! Sorry that I didn't come back to you earlier.

    I had to take a little time. I am still a bit confused. I think you

    have some typos in your first sentences.

    Just to make sure I have grasped the idea: if an image is 75 DPI, this means

    that is has 75 dots per inch, hence in a 2 x 3 image has 150 x 225

    dots total (not pixels, as you have written; each dot is 1/75 of an inch).

    Hence, we know that this file has 150 x 225 dots total, but we don't

    know how many pixels it has. Correct?

    The printer has 300 DPI capacity. Thus it can print 600 x 1500 dots

    for a 2 x 3 file, which means it has a higher resolution than needed for

    the 2 x 3 image with 150 x 225 dots.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    > The printer has 300 DPI capacity.

    Which means either

    To get back to a 2x3 image, it needs to print each source dot 16 times in a 4x4 block.

    Otherwise, you just end up with a much smaller image on the paper if you print the dots on a 1:1 basis.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    Quote Originally Posted by Ducol View Post
    I think you have some typos in your first sentences.
    Hmm...the first sentence is about "depth of greyscale"? No typos there that I can see. I was pointing out that "8 bits per inch in greyscale" was inaccurate (you would measure it in bits per pixel)1 and irrelevant (you're only comparing the density of pixels in each format).

    Quote Originally Posted by Ducol View Post
    Just to make sure I have grasped the idea: if an image is 75 DPI, this means that is has 75 dots per inch, hence in a 2 x 3 image has 150 x 225 dots total (not pixels, as you have written; each dot is 1/75 of an inch). Hence, we know that this file has 150 x 225 dots total, but we don't know how many pixels it has. Correct?
    Your numbers are correct, but your understanding of terminology is not. Pixel is simply short for "picture element". It's the smallest building block of an image, whether that image refers to a file (like a bitmap or jpeg), a screen/monitor or a digital camera. The word "dot" as in "dots per inch" is the same concept as a pixel (the smallest building block of the image), but typically used in the context of a printing device.

    Quote Originally Posted by Ducol View Post
    The printer has 300 DPI capacity. Thus it can print 600 x 1500 dots for a 2 x 3 file, which means it has a higher resolution than needed for the 2 x 3 image with 150 x 225 dots.
    Check your math on that. 3" * 300DPI = 900 dots, not 1500. So printing a 2x3" image on that printer would take 600x900 dots (or pixels).

    You could do some experiments yourself, by getting some grid/graph paper with different sized grids. In the larger-grid (e.g. 1" squares) paper, draw a pattern (something simple like a diamond) by shading in certain different squares. If you transfer that image on a square-by-square basis to the smaller-grid (e.g. 1/4" squares) paper, you will see the image shrinks. To keep the image the same size, you will see you need to use a group of 4x4 squares on the smaller-grid paper for each single square on the bigger-grid paper. Now, re-copy the diamond again on the small-grid paper, using 4x4 squares for each square on the larger-grid paper. But don't color in all 16 squares in the 4x4 section. Only color in every other one. Tape this to a wall and keep walking backwards until you can't see the individual squares. Your diamond should now be grey instead of black. That's your simulated greyscale.

    In that example, the lower-resolution (larger-grid) paper is akin to the original image (the bitmap). The smaller-grid (higher resolution) paper is like the printer.

    Hope that helps.

    1For more info, read up on grayscale and color depth.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to convert existing image to black and white?
    By kkmoslehpour in forum C Programming
    Replies: 9
    Last Post: 10-13-2011, 09:19 PM
  2. RGB to Black&White
    By Rustik_ in forum C++ Programming
    Replies: 30
    Last Post: 08-25-2009, 10:19 AM
  3. OpenGL example cube is black, white, grey only
    By edwardtisdale in forum Windows Programming
    Replies: 7
    Last Post: 09-22-2007, 02:37 PM
  4. Problem reading 8 bit greyscale images !
    By Clueless@work in forum C Programming
    Replies: 12
    Last Post: 07-01-2007, 11:07 AM
  5. Replies: 3
    Last Post: 04-04-2002, 05:27 PM

Tags for this Thread