Don't forget about (lossy) jpeg compression. You'd be better off using GIF or TIFF for this experiment.
identify -verbose  identify -verbose artificial_black_n_white.jpg
Image: artificial_black_n_white.jpg Format: JPEG (Joint Photographic Experts Group JFIF format) Geometry: 24x12 Class: DirectClass Type: Grayscale Endianess: Undefined Colorspace: Gray Channel depth: Gray: 8-bits Channel statistics: Gray: Min: 0 (0) Max: 255 (1) Mean: 141.299 (0.554112) Standard deviation: 123.716 (0.485162) Colors: 30 Histogram: 72: ( 0, 0, 0) black 8: ( 3, 3, 3) grey1 8: ( 2, 2, 2) #020202 6: ( 4, 4, 4) #040404 4: ( 5, 5, 5) grey2 2: ( 7, 7, 7) #070707 4: ( 6, 6, 6) #060606 6: ( 8, 8, 8) grey3 4: ( 10, 10, 10) grey4 2: ( 11, 11, 11) #0B0B0B 6: ( 12, 12, 12) #0C0C0C 2: ( 13, 13, 13) grey5 2: ( 15, 15, 15) grey6 2: ( 17, 17, 17) #111111 2: (233,233,233) #E9E9E9 2: (237,237,237) grey93 2: (239,239,239) #EFEFEF 4: (241,241,241) #F1F1F1 2: (240,240,240) grey94 2: (242,242,242) grey95 2: (245,245,245) grey96 2: (246,246,246) #F6F6F6 14: (249,249,249) #F9F9F9 6: (248,248,248) #F8F8F8 6: (251,251,251) #FBFBFB 6: (250,250,250) grey98 12: (252,252,252) grey99 10: (253,253,253) #FDFDFD 86: (255,255,255) white 2: (254,254,254) #FEFEFE Rendering-intent: Undefined Units: PixelsPerCentimeter Filesize: 834 Interlace: None Background Color: white Border Color: #DFDFDF Matte Color: grey74 Dispose: Undefined Iterations: 0 Compression: JPEG Quality: 75 Orientation: Undefined JPEG-Colorspace: 2 JPEG-Sampling-factors: 2x2,1x1,1x1 Signature: 50739cd131be1b05025077e282769fe030553bfc888402b09988530af +56e96f0 Tainted: False Version: ImageMagick 6.2.5 09/21/06 Q16 file:/usr/share/ImageMagick- +6.2.5/doc/index.html


grep
One dead unjugged rabbit fish later

In reply to Re^6: Perl Image Analysis by grep
in thread Perl Image Analysis by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.