RGBA code for red color [closed] - rgba

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
I'm looking for RGBA code for red color with opacity: Can someone tell me how can i find about it?(or where i can learn more about RGBA colors? Thanks.

rgba(red, green, blue, alpha)
The range for red, green and blue is 0-255.
The high the number, the more presence the color shows.
The range for alpha is 0.0-1.0.
The higher the number, the higher the opacity.
Fully opaque red would be rgba(255, 0, 0, 1)

Related

Combine two single color images into one with CLI (imagemagick?) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm generating "single" color images (B/W and red/white) of our todo schedule to write images to an 3-color e-ink screen, with my Raspberry Pi. First write the black one, then overwrite with red. This works really great, so no help required there.
But I would also like to have the same image available on a website. So I need to have my red image "overwrite" the black one, so I also have the black/red/white image the e-ink shows, as a png/bmp/jpg/whatever. For now we're just using the black one, but I want my overdue stuff in red as well.
I already have imagemagick for the conversions from SVG to PNG/BMP etc., and I'm guessing it should be able to do this. However, I could not find any examples. It's also hard to define the right search parameters, since a lot of people want to combine two images next to or below eachother, not actually combining them.
Does anyone here know how to do this? (I'm not stuck on ImageMagick, but that's the tool I already use)
My guess would be I'd need to make the white in the red/white transparent, then somehow layer it on top... But how?
Change the RED image to 50% opacity
convert red.png -alpha set -background none -channel A -evaluate multiply 0.5 +channel red2.png
Then overlay the 50%RED on the black
convert black.png red2.png -gravity center -composite all.png
Thanks to answers I found elsewhere on transparency, and above here from Bruce on 'composite', I ended up doing:
convert screen-output-red.png -fuzz 30% -transparent white -fill red -opaque black trans.png
composite trans.png screen-output.png combo.png
Haven't figured out if I could do it in one step, but this is good enough for now.
There are several ways to do this with ImageMagick. A very simple method is to make the white transparent then composite the red over the black.
magick img_black.png img_red.png -colorspace rgb \
-fuzz "10%" -transparent white -background white -flatten result.png
First it reads in both images and sets the working colorspace to "rgb" so the result will be color instead of grayscale.
Then it sets a "-fuzz" value of "10%", which is the amount of variance from pure white that will be affected by the "-transparent" operation. You can adjust this amount to suit your needs.
Next the "-transparent white" operation removes all the white and near-white specified by the fuzz value. Since that removes the white from both images, we add a background color of white so the result will be flattened onto that.
Finish by flattening the red image onto the black image onto a white background and write the result to a file.
This command uses ImageMagick v7 on a *nix system. To use it with IMv6 change "magick" to "convert". To use this command in Windows change the continued-line backslash "\" to a caret "^".

How to find bright areas inside an image (and also how to find shaded areas in an image)

I have an image:
How do I find areas of different intensity in an image? How do I find all the bright areas that differ to the original brightness, and contrary-wise, how to find the dark areas, originating from shadows in this case?
Human eye realises the change in brightness, but how would a program do that?
Find bright and dark spots in one picture:
There are multiple approaches to this. I am gonna suggest just a couple of them here.
You can find the mean of the RGB values of the image and use the lower 10% of the pixels which vary the most from the mean as darker pixels and the highest 10% of the pixels which vary the most from the mean as brighter pixels.
You can set a predefined threshold for a bright pixel, lets say RGB=[220,220,220] and dark pixel as RGB=[30,30,30] and iterate through the image and classify the pixels accordingly.
You can also look into dynamic thresholding for the second method and your approach to the problem can be optimised accordingly.
Find changes in bright and dark spots:
There are multiple ways to handle this as well. One approach can be the mean-value subtraction technique. The human eye responds to change with respect to the previous image which was perceived. The program needs to do the same where it needs to compare the changes to the previously captured frame(s). Look into temporal filtering to get a further idea about this..
Hope this helped

Isolate brown by rgb values [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am looking to isolate "brown" colors by rgb values. Not just 1 brown color, but the wide spectrum of colors that are perceived as brown - tan, suede, dirt, etc.
Any ideas on how to do this? I'm thinking that maybe if Red is less than 128, and Green is between 70 and 138, and blue is less than 128, than it appears brown. Something along those lines.
A really simple heuristic would be something like, in pythony pseudocode
def isBrown(red, green, blue):
# Kind of maximum lightness
if blue > parameter_1
return False
# how green or red tinted can it be
if absolute_value(red - green) > parameter_2:
return False
# Light brown is just yellow or orange
if maximum_of(red, green) > parameter_3:
return False
else:
return True
The tune parameters 1 through 3 until it works nicely. Perhaps replace if absolute_value(red - green) > parameter_2: with if absolute_value(red - green*parameter_2b) > parameter_2a: so that more greeny or reddy ones are selected depending on parameter_2b. Perhaps change maximum_of to something else. etc. etc.
It really depends what you consider to be brown. It is a colour category for which there is rather high inter-subject variability and strong contextual effects (colours next to it changes how it looks).
Think you need to use something like this: http://www.colorpicker.com/ and look at the shape of the colours you decide on and then work out how to express that algorithmically.

Why rgb and not cmy? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Seeing as how the three primary colors are cyan, magenta and yellow (CMY), why do monitors and almost all the GUI components out there use red, green and blue (RGB)? (If I'm not mistaken, printers use the CMYK model.)
Is there a historical, hardware/software, or other reason for it?
There's a difference between additive colors (http://en.wikipedia.org/wiki/Additive_color) and subtractive colors (http://en.wikipedia.org/wiki/Subtractive_color).
With additive colors, the more you add, the brighter the colors become. This is because they are emitting light. This is why the day light is (more or less) white, since the Sun is emitting in almost all the visible wavelength spectrum.
On the other hand, with subtractive colors the more colors you mix, the darker the resulting color. This is because they are reflecting light. This is also why the black colors get hotter quickly, because it absorbs (almost) all light energy and reflects (almost) none.
Specifically to your question, it depends what medium you are working on. Traditionally, additive colors (RGB) are used because the canon for computer graphics was the computer monitor, and since it's emitting light, it makes sense to use the same structure for the graphic card (the colors are shown without conversions). However, if you are used to graphic arts and press, subtractive color model is used (CMYK). In programs such as Photoshop, you can choose to work in CMYK space although it doesn't matter what color model you use: the primary colors of one group are the secondary colors of the second one and viceversa.
P.D.: my father worked at graphic arts, this is why i know this... :-P
The difference lies in whether mixing colours results in LIGHTER or DARKER colours. When mixing light, the result is a lighter colour, so mixing red light and blue light becomes a lighter pink. When mixing paint (or ink), red and blue become a darker purple. Mixing paint results in DARKER colours, whereas mixing light results in LIGHTER colours.
Therefore for paint the primary colours are Red Yellow Blue (or Cyan Magenta Yellow) as you stated. Yet for light the primary colours are Red Green Blue. It is (virtually) impossible to mix Red Green Blue paint into Yellow paint, or mixing Red Yellow Blue light into Green light.
The basic colours are RGB not RYB. Yes most of the softwares use the traditional RGB which can be used to mix together to form any other color i.e. RGB are the fundamental colours (as defined in Physics & Chemistry texts).
The printer user CMYK (cyan, magenta, yellow, and black) coloring as said by #jcomeau_ictx.
You can view the following article to know about RGB vs CMYK: RGB Vs CMYK
A bit more information from the extract about them:
Red, Green, and Blue are "additive
colors". If we combine red, green and
blue light you will get white light.
This is the principal behind the T.V.
set in your living room and the
monitor you are staring at now.
Additive color, or RGB mode, is
optimized for display on computer
monitors and peripherals, most notably
scanning devices.
Cyan, Magenta and Yellow are
"subtractive colors". If we print
cyan, magenta and yellow inks on white
paper, they absorb the light shining
on the page. Since our eyes receive no
reflected light from the paper, we
perceive black... in a perfect world!
The printing world operates in
subtractive color, or CMYK mode.
the 3 additive colors are in fact red, green, and blue. printers use cmyk (cyan, magenta, yellow, and black).
and as http://en.wikipedia.org/wiki/Additive_color explains: if you use RYB as your primary colors, how do you make green? since yellow is made from equal amounts of red and green.
This is nothing to do with hardware nor software. Simply that RGB are the 3 primary colours which can be combined in various ways to produce every other colour. It is more about the human convention/perception of colours which carried over.
You may find this article interesting.

How to change the colors of a PNG image easily? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have PNG images that represent playing-cards.
They are the standard colours with Clubs and Spades being blank and Diamonds and Hearts being red.
I want to create a 4-colour deck by converting the the Clubs to green and the Diamonds to blue.
I don't want to re-draw them but just changing them by hand seems a lot of work since the colours are not all "pure" but graded near the edges.
How do I do it?
Photoshop - right click layer -> blending options -> color overlay
change color and save
This should be fairly straightforward in the gimp http://gimp.org/
First make sure your image is RGB (not indexed color) then use the "color to alpha" feature to turn the clubs/diamonds clear, then fill or set the background or whatever to get the color you want.
If you are going to be programming an application to do all of this, the process will be something like this:
Convert image from RGB to HSV
adjust H value
Convert image back to RGB
Save image
Use Photoshop, Paint.NET or similar software and adjust Hue.
Ok guys it can be done easy in photoshop.
Open png photo and then check image -> mode value(i had indexed color). Go image -> mode and check rgb color. Now change your color EASY.
If you are like me and Photoshop is out of your price range or just overkill for what you need. Acorn 5 is a much cheaper version of Photoshop with a lot of the same features. One of those features being a color change option. You can import all of the basic image formats including SVG and PNG. The color editing software works great and allows for basic color selection, RBG selection, hex code, or even a color grabber if you do not know the color. These color features, plus a whole lot image editing features, is definitely worth the $30. The only downside is that is currently only available on Mac.

Resources