Ideas on how to implement the color wheel, and find the related information using RGB in computer? - image

Here is a color wheel, typically from the web. I would like to create something like the user input the Yellow color code, and I am able to find the complementary color of Yellow is purple. Also, I would like to find the nearby color, light green, and the light orange. How can I implement it in a computer science way? or any existing algorithm to do so? Thanks.

Related

A way to change the colors of the NetLogo interface controls or the plot border?

I'm trying to adjust the colors of the NetLogo interface for images which will go into a book. The light purple or aqua colors of the controls and the beige-ish border of the plot are not ideal, as they will be grey in black and white and make the text harder to read. I've checked the NetLogo documentation for some way to edit these, and I can't find anything about this.
Is there any way to change the color on these?

Is there a way to reorganise pixels in an image from darkest to brightest in Gimp?

I do a lot of Zoom quizzes, and am always looking for new and interesting rounds to include. Recently I saw a screenshot of a quiz where someone had taken album covers and rearranged the colours in the image so that all the darkest colours were in the top left and there was a smooth gradient to the lightest colours in the bottom right.
I am basically looking for a way to do this myself. Is there a tool on Gimp that will allow me to rearrange all the pixels by their colour value in a smooth gradient? I'm not tied to Gimp and would be open to trying other programs that could do this.
Thanks.

Classifying color in dark surroundings

In a program I am working on, I am trying to classify colors based on their RGB values as red, orange, yellow, green, blue, or white. I am classifying them by comparing the given RGB values to a constant "ideal" value for each color and finding the minimum euclidean distance in a three dimensional space. However, I am having trouble when the color I am analyzing comes from a dark image as the current program has difficulty differentiating between orange, yellow, and red within dark images. How should I fix or work around this issue?
The environment is always going to cause problems. Say if the only light source is red you won't be able to tell apart gray, green or blue.
If your situation is not that complex you could try to adjust the image. Almost all image processing software/libraries have some functions to that end. Probably the best solution would be to have some calibration components in the scene like a white ball that you know what color it should be and can help you adjust the image and make the color identification easier.

UIImage - highlight single color only

I need to convert an image to greyscale except for a single color. For example, if there is some red in the image (like a red bus), this will remain in color, but the rest of the image will remain in black & white.
I think I should be able to do a rudimentary job of this by going over each pixel individually, such as here: http://brandontreb.com/image-manipulation-retrieving-and-updating-pixel-values-for-a-uiimage . I am assuming I would just leave certain pixels alone if their red component was above a certain amount, and green/blue was below a certain amount. Otherwise, set the pixel to grayscale. Is this a good approach?
I'm more interested in whether or not it is possible to do to the live camera input, such as with a Core Image filter, or using GPUImage, but I haven't been able to find any suitable filters. Any suggestions?
Update:
This seems to be possible using GPUImage with a GPUImageLookupFilter, as per: https://stackoverflow.com/a/19340583/334982
I've created a lookup.png file in Photoshop, by dropping the Saturation for all colours except red to 0. This works ok, but it doesn't seem to grey out all colours. For example, my skin still looks fairly skin coloured, and my brown table is still fairly brown.

CIFilter HueAdjust

How to programmatically change the hue of UIImage?
I am using the above page's advice, for Core image filter CIFilter. The only problem I am having is my when I rotate to a yellow hue, it's a dark mustard yellow, and I can't get the brightest vibrant yellow, ie R:255 G:255 B:0. I have images that are on layers that are made up of a simple color R:255 G:0 B:0 I just want to rotate around, to get the basic colors plus orange. Orange works fine tho.
I just don't know why when I rotate from R:255 to try and get R:255 G:255 Yellow it's a dark yellow.
I am using 1.04719755 for the Yellow float, at deltaHueRadians
I don't know it's just weird this is the 3rd attempt at this but I keep getting a dingy yellow.
I realized the problem.
In Photoshop I have done so many Colorize operations when I used to photo edit, I got them confused with Hue Rotation.
Basically when you Colorize in Photoshop, it will "Colorize" the image not just Hue Rotate the values.
The difference between the two is a very thin line depending on what images you use. I don't really feel like going into a complete explanation but...
Say you have a grey cube on a layer, and you COLORIZE the image, the cube will rotate colors as you use a slider. If you Hue rotate it will stay grey.
But if you take a red cube, and hue rotate, then the hue rotation will take you thru colors, not necessarily all of them tho like a colorize.
I believe the issue has to do with all that good ole HSV RGB matrix crazy math problems. Which I am not doing right now. Keeping it simple.
I decided to just do a colorize method with:
CGContextSetBlendMode(context, kCGBlendModeMultiply);
With grey objects and this is perfectly what I wanted.
from googling I found this:
http://coffeeshopped.com/2010/09/iphone-how-to-dynamically-color-a-uiimage

Resources