Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Create a color function from colors in an image
ResourceFunction["ImageColorFunction"][img] gives a color function based on the colors in img. |
| SampleCount | Automatic | if a positive integer, the maximum number of key or indexed colors |
| SampleOrder | "Dominance" | order of the key or indexed colors |
| Smoothed | True | whether key colors are evenly spaced (True) or spaced according to dominance (False) |
| Indexed | False | whether the color function is continuous (False) or discrete (True) |
| "Dominance" | most dominant color (0) to least dominant (1) |
| "Red" | least red (0) to most red (1) |
| "Green" | least green (0) to most green (1) |
| "Blue" | least blue (0) to most blue (1) |
| "Hue" | least h (0) to greatest h (1) in Hue[h] |
| "Saturation" | lowest saturation (0) to highest saturation (1) |
| "Brightness" | darkest color (0) to brightest color (1) |
Make a color function from an image:
| In[1]:= | ![]() |
| Out[1]= |
Use the color function in a graphics expression:
| In[2]:= |
| Out[2]= | ![]() |
Change the number of key colors in the color function:
| In[3]:= | ![]() |
| Out[3]= | ![]() |
Change the order of key colors in the color function:
| In[4]:= | ![]() |
| Out[4]= | ![]() |
Change the spacing of key colors in the color function:
| In[5]:= | ![]() |
| Out[5]= | ![]() |
Make a discrete color function:
| In[6]:= | ![]() |
Use the function as an indexed color scheme:
| In[7]:= |
| Out[7]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License