Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

8-bit, grayscale to rgb color 2

Status
Not open for further replies.

pmover

Technical User
Jun 9, 2004
14
0
0
US
curious question from a relatively intro user of PS CS.

in scanning several black & white negatives, is there a technique or process by which the scanned image can be converted from 8-bit, grayscale to rgb color in PS CS? simply choosing RGB does not convert the image, rather add color to image. understand that for a grayscale image, there are 256 shades of gray. how to assign a color value to a corresponding gray value is the delima.

i'm using an mac computer.

thanks!
-pmover
 
PhotoShop itself will not do that, you have to go in and color each item manually. Very time consuming but can be done, however it will look more like a colorized photo as apposed to a true color photo.

Tony Perkins
 
follow-up question...

why is it that color images can be converted to grayscale and not vice versa?

i do not readily understand.

-pmover
 
When you convert to b/w, you throw away the color information. How can the program make up this information later to convert it back to color? It can't.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
pmover

Photoshop might be impressive but it's not magical... what would you say if someone gave you a black and white photograph and asked you to print it in colour!?

As TomThumbKP states, when you convert a colour image to greyscale it is demoted. It is not possible to promote the image to colour afterwards. This means that now only 1 x 8-bit channel (which equates to 256 tonal shades) is storing the pixel (picture element) information.

To understand this further it helps to understand binary:-

Code:
128  64  32  16  8   4   2   1   <--- columns
——————————————————————————————                  = 255 maximum value
 1   1   1   1   1   1   1   1   <--- 0 or 1

the maximum number that can be obtained from this 8-bit (8 columns) code is by putting 1's in each column

1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 = 255

0 .. 255 = 256 maximum combinations

this 8-bit code can represent any number between 0 and 255 - for example 21 decimal = 10101 binary

this theory expands to RGB like this

R (Red) = 1 x 8-bit code
G (Green) = 1 x 8-bit code
B (Blue) = 1 x 8-bit code

Each 8-bit code is exactly the same as a greyscale picture (check out the channels in a RGB picture in Photoshop)

In order to represent this a 24-bit code is required (8 + 8 + 8)

24 bit = a palette of 16.7 million colours

Here's the proof...

[tt]1 bit code = 2
2 bit code = 4
3 bit code = 8
4 bit code = 16
5 bit code = 32
6 bit code = 64
7 bit code = 128
8 bit code = 256
9 bit code = 512
10 bit code = 1024
11 bit code = 2048
12 bit code = 4096
13 bit code = 8192
14 bit code = 16384
15 bit code = 32768
16 bit code = 65536
17 bit code = 131072
18 bit code = 262144
19 bit code = 524288
20 bit code = 1048576
21 bit code = 2097152
22 bit code = 4194304
23 bit code = 8388608
24 bit code = 16777216 <--- 16.7 million colours[/tt]


Hope this makes sense! :)


Kind Regards
Duncan
 
How does photoshop create greyscale out of RGB? It takes a color, analyses the amount of red, green and blue, then averages it out to give one value. For example, if red = 200, green = 0, blue = 100, it may take 200 + 0 + 100 = 300, then divide it by 3 to get an average of 100. That will be the greyscale value. (actually, this is an oversimplification -- photoshop doesn't average the values quite that evenly, but it gives you an idea).

Suppose you have another color that's 100 red, 200 green, 0 blue. The average is still 100+200+0 = 300, divide by 3 = 100, so it will give the same greyscale value.

Now let's imagine that you're given a greyscale value of 100. What way would you color it? 200,0,100? 100,200,0? 100,100,100? It's impossible to know, which is why the conversion in photoshop only works one way.
 
duncdude & blueark!

thanks much! a star for you!

as a gearhead, i now understand!

-pmover
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top