I need to display an outline of a dog in a window. I then need to be able to change the colour for different part of the dog by inputting numbers into entry boxes- for example if I put a '1' in the 'head' entry box, the head changes to a yellow colour. The dog should be white by default.
I can just create 4 images (one for the head, body, legs, and tale) to change each part of the bod. I've thought about changing the rgb values of each image to change the colour, but this would also change the colour for the outline (meant to stay black). The only other thing I could think of was making a red, blue, green, yellow, blue, etc. version of each image (head, body, legs, tail), and then just displaying the red version of the image when I need to (and the same for other colours).
I need to know if there is any other way to do this (perhaps with the canvas widget?) before I code it because It will take a long time to change the colour of each image. I just have no idea where to start.
Thanks in advance for your answers
You will have to make different widgets for each part of the dog(e.g: Head, Abdomen etc.) and you will need different images for the dogs part and color, after that you can implement a button that changes the color with the 'if' function.
I want to create a UI where in there are three indicator lights, Green, Yellow and Red where each has a switch on and off
then everytime a switch is turned on or turned off, it will create a csv log indicating the timestamp when a light was on or off, then individual columns for green, yellow, red light and it should log 0 (zero) when light is off then 1 (one) when a light is turned on
is that possible using tkinter? thank you so much!
I have 456 .PNG icons with a white image on a blue background, but the background is pixelated. So when I use mogrify to replace a colour, lots of parts of the icon won't become the red colour I want, and stay in a shade of blue. Is there a way to replace all colours, all shades of blue, and keep the white icon intact? Because mogrify recolouring the icons would turn the whole icon red, even the white part.
I have a feeling the solution should be simple, but after some googling and some messing around with Imagemagick and Phatch, I can't seem to figure it out.
I kind of need a batch solution, since theming all the icons manually would be... Something I don't want to do.
I am open for any suggestions and I apologizs in advance if this question turns out to be a duplicate!
If you need more information, just ask, and I can give it to you!
The "+opaque color" option will select all colors except the named one, and turn them to the fill color. Thus,
mogrify -fill red +opaque white *.png
will turn everything except the white pixels to red.
In ImageJ ROI manager one can define a color by name (green, yellow, magneta, etc). I have been struggling to find a list of allowed color names. Does anybody know where to find a comprehensive list of color names used by ImageJ?
In the ROI manager documentation of the ImageJ User Guide, it is written:
The nine default selection colors (black, blue, cyan, green, magenta, orange, red, white, yellow) can be typed textually.
The same can be found in the source code: the RoiProperties dialog uses the ij.plugin.Colors class to set the stroke color.
Why do computers use RGB (red, green, and blue) values for color composition rather than the primary hues, red, yellow, and blue?
The hues of magenta, yellow, and cyan are primary for subtractive combination (e.g. paints or inks) rather than additive combination such as light where red, green, and blue are primary.
Wikipedia has more detail on the whys and wherefores.
Computers use the additive colour model, which involves adding together RGB to form white, and is the usual way of forming colours when using a light source.
Printers use subtractive color, normally using Cyan(C), Magenta(M), and Yellow(Y), and often Black(K). Abbreviated CMYK
Cyan is opposite to Red, Magenta is opposite to Green, and Yellow is opposite to Blue.
This is a really simple explanation of a complex issue, the guy that came up with additive colour was James Maxwell (yes, that one), so if you dig into the many articles about him, that may explain much better.
Just for clarification, the primary colours you learn at school are incorrectly given as red, yellow & blue. In fact they are Cyan, Yellow & Magenta, just like your inkjet printer. As the previous posts state, Cyan, Yellow & Magenta are the subtractive prime colours; you see what the pigments reflect. Red, Green & Blue are the additive primary colours that CRTs, Plasmas & LCDs use.
For efficiency: the RGB model is additive. For example, superimpose pure red and pure blue light, and you get magenta. It's also easy to build into monitors. If you take a magnifying glass and look at your monitor, you'll be able to see individual red, green and blue dots that vary in intensity to compose the colors needed. As ffpf mentioned, check out Wikipedia. Here's a link to the article on the RGB color model.
Computer screens emit light to display pixels. Mixing different colours of light is called Additive colour. Additive colour uses red, green, and blue as primary colours.
Subtractive colour is how different colours of materials mix, such as paints. Subtractive colour uses red, yellow, and blue as primary colours.
How I think of it is that when light reflects off an object into your eyes, the object absorbs some of the colour, and reflects the rest to your eyes. So if an object's green, it means it's absorbing the red and the blue out of the white light. This is why mixing red, green, and blue light creates white light, but mixing red, yellow, and blue paint creates black (the mixed paint now absorbs all primary colours.) That is the reason for the difference between additive and subtractive light.
Because combining light sources (which computer monitors do) does not work the same way as combining printed ink. It's just a guess.
Color is Not Real
Color is a perception. Light exists in different wavelengths or frequencies, but the only thing that makes a certain wavelength appear to be a "color" is the nature of human perception.
The Long, Medium, and Short of it
The eye has three types of "cone" cells where are sensitive to one of three bands of light, long, medium, or short wavelengths (about 700nm to 380nm). "Long" we think of as red, medium—green, and short—blue. But each cone type covers a wider band, and there is definite overlap, especially of the long and medium cones.
It's All In Your Head
Most of the human visual system (HVS) is in the brain (62% of the brain is involved in visual processing). The overlapping cone responses are filtered by ganglion cells in the back of the eye, sent over the optic nerve, and then further filtered and processed by the visual cortex.
No Such Thing As "Primaries"
While we may call some colors "primary", there is no set of just three real colors that can make up all other colors. Pantone requires 14 different dyes to make up that set of colors for instance, and a typical artist will load their paulette with a dozen colors from which to mix.
TVs/Monitors use red, green, and blue "primaries" with wavelengths chosen with the intent to stimulate each of the three types of cones in the eye as independently as possible. However this is impossible to achieve due to the cone bandwidth overlap.
As such, you "could" say that red, green, blue were the primary colors of light, but even that is not completely correct. Yellow stimulates the "red" and "green" cones about equally, in the middle of the cone overlap. When a computer monitor displays yellow, it is displaying separate green and red, which does not mix in the air to make yellow — it just stimulates the red and green cones causing the brain to perceive yellow.
We perceive yellow, and not a reddish-green nor a greenish-red, due to the opponent process of color that is a result of the ganglion cells in the back of the eye.
Red/Green is an opponent pair, and Yellow/Blue is an opponent pair, making up four "unique" colors (Red, Yellow, Green, Blue). Since Yellow is easily created with red and green light, additive color processes typically omit yellow.
Subtracting Light
Reflected surfaces (and transparent film) "subtract" light by absorbing it, reflecting (or transmitting) only certain wavelengths. As it turns out, we get the best gamut of colors using "primaries" cyan, magenta, and yellow when working with subtractive reflected/translucent colors, as opposed to emitted light colors where we are trying to selectively stimulate each of the three cone types using red, green, and blue.
Also, it is useful to note that cyan is the "opposite" of red, magenta "opposite" of green and yellow "opposite" of blue.
And for the record, in an sRGB monitor, the red is really a red/orange. The green is really a green/yellow, and the blue is more of a violet.
For either additive or subtractive processes, the specific colors chosen are (generally) intended for creating the widest gamut of color, limited by various reasons of economics and practicality.