Re: Need text file w/ grayscale image brightness



rcoutts@xxxxxxxxxxx wrote:

I'm putting a figure together for a paper and need a simple image that
has a grayscale image next to a grid of numbers that represents to gray
level of each pixel (e.g., 00=black and FF=while). So, the grid would
look something like

23 23 25 23 32 38 29 39 38 29
39 29 39 29 33 29 29 38 29 39
12 13 14 16 23 23 43 56 38 29
28 38 10 29 39 23 83 36 32 10
:
:

where each number would be the intensity for either decimal (0,99) or
hex (0,FF).

The figure is for a sensory perception paper and I don't need to be
real scientific about its accuracy. I loaded the image into PhotoShop
and saved it in various text formats, such as RAW, EPS, and PDF, but
the grid of numbers didn't represent the grayscale like what I need --
is there a simple way to get what I'm after? I don't mind editing the
file, like to add spaces between the numbers, if that what it takes to
get what I need. I could use PhotoShop to record the pixel color by
hand and populate the grid manually by sampling with the eyedrop tool,
but I'm hoping to avoid such a tedious approach.

Thanks,
Rich




Here's one fairly easy way:

First, save as a binary PGM, using for example IrfanView.

Then, to get the hex text, you could use for instance HexEdit (even version 1.0):

http://www.expertcomsoft.com/

That tool has an option to "Edit > Copy As > Hex Text".

Just make sure you skip over the PGM header bytes at the start of the file. You may have to reformat the lines a bit to get exactly what you want, but this will be much easier than sampling each pixel in Photoshop.

MikeT
.



Relevant Pages

  • Re: mobile phone logo editor
    ... Drawing on the screen is done by clicking on a pixel... ... DrawGrid; // Redraw the grid when the form redraws itself... ... pic: TPicture; ...
    (alt.comp.lang.borland-delphi)
  • Re: I cant believe I never thought of asking all of you this question....
    ... It's okay to use "snap to grid", ... pixel by pixel changes can ... row as a gap between lines of control (so the real ... builder builder) by Ken Levy shows howto. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Performance question
    ... I need all 8 bits of data for grid location in order to determine what ... byte and use it to determine what color pixel to draw on screen when the ... I actually paint ... You'd store the state of the grid as a BDD proposition. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: MSFlexGrid InFlexible
    ... According to my own tests in order to fully display all its columns so that they occupy the full available width of the grid, the client width of an MSFlexGrid needs to be the exactly the same as the combined width of all the columns, except if it is set to have a horizontal scrollbar in which case it needs to be one pixel greater otherwise it will display its scroll bar. ... According to my own tests the combined width of all its columns is the exact requirement, unless there is a horizontal scroll bar set and you do not want it to show in which case you need exactly one extra pixel overall, regardless of the number of columns. ...
    (microsoft.public.vb.general.discussion)
  • Re: Pixel Snapping?
    ... It's a default that PhotoShop doesn't "snap" to individual pixels. ... If you set your gridlines to 1 pixel subdivisions, ... Be sure to view your grid with the "snap to grid" turned on. ...
    (alt.graphics.photoshop)