I'm trying to reduce colors from million to 7 exact colors. It's a fabric design, so I want to separate greens from the other colors. However, when I want to pick greens, other different colored pixels that belong to motifs are getting included in the selection area.
The good news.... yes, it can be done in practically any version of Photoshop.
The bad news.... It can be a difficult task depending upon the artwork. In addition, to requiring some experience with creating selections and masks.
Trying to remember CS2:
Select > Color Range... may possibly get a good starting selection, as mentioned in the comments above.
Quick Mask would allow you to "paint" areas you want to be part of a selection.
You could use the
Channels Panel combined with tools such as the Magic Wand to get a selection.
And of course, there's the Magic Wand tool or Pen tool or Lasso tool to draw a selection.
There are a great many methods to create a selection. Essentially just use whatever is easiest for you to get a good starting selection. No method is just going to be "perfect" with a click. What you describe "other different colored pixels get selected" is due to anti-aliasing. This is going to happen with practically any selection method if the artwork has anti-aliasing. There's no way to easily or automatically get around anti-aliasing in most cases.
After a selection is created, it's a matter of refinement. Once you have a selection, turn it into a layer mask. Once you have a layer mask, you can then go in and manually use a brush to paint away any anti-aliasing pixels you do not want as part of the selection.
Basically the procedure would be the same as removing a background from an image but in this case you'd be removing everything except the color you want to retain.
Seeing a screen shot of specific artwork may yield more detailed instructions. However, in most case the above steps are pretty much the same.