On a black and white image, is there a way to calculate how much black and how much white is used?

On a black and white image, is there a way to calculate how much black and how much white is used?

  • Are you talking about the DMAX of the darkest area or what percentage of the area is covered in black?

  • I think they may be misinterpreting your question here, or maybe I am?

    You have a black and white image and want to know how many pixels are black and how many white,
    and then you want to know how much that is in square millimeters, right?

    Not sure I can help you all the way but here is an online calculator to count the number of pixels for each color.
    But since a pixel doesn't really have a specific size, you have to manually calculate how much that is in sq mm,
    based on the size of the image and its resolution in pixels per mm.

    • Hi Ronny. Number of pixels of each colour as per your calculator, then calculate the percentage black. Then for the image calculate the physical size when placed as mm² and then apply the percentage. Important to measure the image physical size at print resolution.

    • Sub bhbp_Black_White_Area
      'WE MUST HAVE ONLY BLACK AND WHITE FILLED SHAPES
      'RGB COLOR PALETTE
      ActiveDocument.Unit = cdrMillimeter

      For Each bhbp_shape In ActiveDocument.ActivePage.Shapes
      If bhbp_shape.Fill.UniformColor.RGBRed = 0 Then 'And bhbp_shape.Fill.UniformColor.RGBGreen = 0 And bhbp_shape.Fill.UniformColor.RGBBlue = 0 Then 'white fill
      BhBp_Area_white = BhBp_Area_white + Round(bhbp_shape.DisplayCurve.Area, 2)
      End If

      If bhbp_shape.Fill.UniformColor.RGBRed = 255 And bhbp_shape.Fill.UniformColor.RGBGreen = 255 And bhbp_shape.Fill.UniformColor.RGBBlue = 255 Then 'black fill
      BhBp_Area_black = BhBp_Area_black + Round(bhbp_shape.DisplayCurve.Area, 2)
      End If

      BhBp_Area = BhBp_Area + Round(bhbp_shape.DisplayCurve.Area, 2)
      Next

      MsgBox BhBp_Area & " mm2 IS AREA OF ALL SHAPES" & Chr(13) & BhBp_Area_white & " mm2 IS AREA OF WHITE SHAPES" & Chr(13) & BhBp_Area_black & " mm2 IS AREA OF BLACK SHAPES"

      End Sub