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?
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.
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...
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
0 = 100% black
256 = White
(not sure if something is "lost-in-translation here....)
I know how grayscale works. I have an image in jpeg format. The image has two different types of rocks, one that is light colored and another that is dark colored and therefore the grayscale value will correspond with the rock type. I want to take those grayscale values and view them in tabular format so that I can run spatial statistics on the values and quantify the spatial patterns of the different rock types. I do not know how to go from the jpeg to viewing the grayscale values in a table. I suppose it's quite easy and perhaps you're confused by my stupidity, but all I want to do is view the actual numbers in a table rather than see the shades of gray.
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.
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.
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).