0

My data include pictures of some products that I manage to extract their major RGB colors into four columns as displayed in the table below ("product ID", "R", "G", "B"). Now, I want to create the fifth column "color code" to display the actual color from the RGB code. Please see the demonstration here.

enter image description here

I plan to use this "color code" column as a filter. I will show this column as a pallet or a drop-down list so that my users can select the color(s) that they want to see the products or other information. The platform to build the report with the filter will be BI tools (PowerBI/QuickSight) or Excel. Note that my product pictures are currently stored in AWS S3.

My initial plan is to create an image, like a square filled with the color for each product, using its RGB code. Then store those images in the data warehouse and call them for filter later.

Can you please recommend the best way to create the type of color data as described for speed and efficiency?

d.b
  • 32,245
  • 6
  • 36
  • 77
  • Note that there are 16 million RGB colors, using exact matches probably won't be useful. – Mark Ransom Dec 16 '22 at 17:30
  • Welcome to SO. This isn't a discussion forum or tutorial. Please take the [tour] and take the time to read [ask], [mre] and the other links found on those pages. Have you tried anything and found it lacking? If so post your attempt and explain what is wrong with it. – wwii Dec 16 '22 at 17:31
  • 1
    [How to create a new color image with python Imaging?](https://stackoverflow.com/questions/38900511/how-to-create-a-new-color-image-with-python-imaging) - searching with `python make a rectangular image of a single color site:stackoverflow.com` found that - there are other results. – wwii Dec 16 '22 at 17:34
  • 1
    Data frames don't "display" colors. Likely the platform you use to generate your reports will have the ability to display colors based on the RGB values or hex color code. If you're asking how you can convert RGB values to a hex color code, see https://stackoverflow.com/questions/3380726/converting-an-rgb-color-tuple-to-a-hexidecimal-string – Pranav Hosangadi Dec 16 '22 at 17:35
  • ... or https://stackoverflow.com/questions/53875880/convert-a-pandas-dataframe-of-rgb-colors-to-hex – Pranav Hosangadi Dec 16 '22 at 17:40

0 Answers0