Skip navigation
Rjaecks
Currently Being Moderated

Saving an image as a table of grayscale values?

Apr 12, 2012 10:43 AM

I have an image that is in grayscale and I need a table that displays each pixels grayscale value.  Is there a way to save the image in some tabular format or can I convert it any other way in photoshop?

 
Replies
  • Currently Being Moderated
    Apr 12, 2012 10:58 AM   in reply to Rjaecks

    I have an image that is in grayscale and I need a table that displays each pixels grayscale value

    Do you know what you asking? if the image is 12 px x 12 px you can manualy do it... but lets say in a landscape image, grayscale 8 bit, with 256 levels of intensity, and the image is 3000 x 3000 px you will have a table with 9 million rows. Px 1 = 150 px 2 = 151 px 3 = 150... and so on.

     

    G

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2012 11:22 AM   in reply to Rjaecks

    I want to put the table of grayscale values into an excel spreadsheet and run an analysis on the values.

    What/ why... maybe I can help you better...

     

    that said:

     

    Grayscale (8 bit) has 1 channel. (value percentages of black) ie: 1 channel x 8 bits  = 8.  So 2^8 = 256. in other words, There are a maximum of 256 Grayscale

    values.

     

    0 = 100% black

    256 = White

     

    G

     

    (not sure if something is "lost-in-translation here....)

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2012 12:16 PM   in reply to Rjaecks

    If I understand what you want to do...

     

    With the Grayscale image open, open the info panel (F8 or window>info) select the Eyedroper tool, in the main bar, select sample size, (point, 3x3, up to 101 x 101) hover over the image. The info panel will display the info in %. You can change the panel options to read grayscale. You can also double click on the color picker and with the window open click on the image, the color picker will display info in this case (RGB values should stay the same with each click) and will be the grayscale value.

     

    You can also click and hold the eyedropper tool icon to bring up other related tools: colour sampler being one, but you can only place 4 at a time.

     

    this help?

     

    G

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2012 12:55 PM   in reply to Rjaecks

    You have posed a reasonable question. The short answer is that Photoshop does not have a utility to provide the data you require as you would like it. The closest feature it has which may be of some use is the measurement facility in the Extended version of Photoshop.

     

    Using the measurement facility you can draw a selection around an area of your choosing (one of the rocks, for example) and take the measurement. It will provide you with several pieces of data including Gray value max, min, mean, median, integrated density and histogram. Area & perimeter of the selected area are also included and a few other parameters. All of these data including the numerical data of the histogram can be exported out of Photoshop to be used in a spreadsheet. If these data were useful, you could do a selection around the other rock and do a comparison.

     

    The raw data behind an image can be had from its psd file, but you need to know have some tools to digest that data.

     

    Paulo

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2012 1:06 PM   in reply to Rjaecks

    Using the Extended version of Photoshop you can extract all kinds of image data. You should be able to find something there. Here it shows min, max and average of pixel values (among other things) of a image selection. All can be exported as csv...

     

    scrn01.jpg

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2012 1:23 PM   in reply to Paulo Skylar

    I forgot to add that you may find the best work environment for your type of task to be the combined use of Photoshop Extended and MATLAB. Communications exist between these programs  using Photoshop JavaScript interface and the MATLAB library interface.

     

    Paulo

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2012 1:51 PM   in reply to Rjaecks

    Which one ?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2012 2:26 PM   in reply to Rjaecks

    Thanks.

    I believe you had a typo in your last posting.  GdalTools is the plugin name.

     

    Paulo

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2012 10:59 PM   in reply to Paulo Skylar

    Maybe Pauls Riggott’s Script (post 5) can help if you are willing to substitute L for K (pasting the grayscale image into the L-channel might be employed).

    http://forums.adobe.com/message/4110430#4110430

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points