RGB values to an image

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bhag
    New Member
    • Jan 2014
    • 4

    RGB values to an image

    Hi,
    I have a data set which contains RGB values. The RGB colours are clustered as 1,2,3 and 4. The file is like this.
    R G B Cluster
    12 2 123 1
    23 32 45 1
    21 56 45 2
    12 57 87 2
    ....

    I want to display these data according to the clusters like yellow color for cluster 1, Black for cluster 2 and so on. Could you please tell me how to do this in Python?
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    Create a dictionary with the cluster numbers as keys and the display colors as corresponding values as in
    Code:
    colorDict = {1: "Yellow", 2: "Green")

    Comment

    Working...