By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,985 Members | 1,712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,985 IT Pros & Developers. It's quick & easy.

RGB values to an image

P: 4
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?
Jan 23 '14 #1
Share this Question
Share on Google+
1 Reply


bvdet
Expert Mod 2.5K+
P: 2,851
Create a dictionary with the cluster numbers as keys and the display colors as corresponding values as in
Expand|Select|Wrap|Line Numbers
  1. colorDict = {1: "Yellow", 2: "Green")
Jan 23 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.