Solved

RGB model

Posted on 1998-03-17
5
436 Views
Last Modified: 2012-05-04
I wanted to know what relation betwen red, blue and green in the RGB model gives me all the variety (density) for the blue color (cyan, solid blue,....)
0
Comment
Question by:ciri
  • 3
  • 2
5 Comments
 
LVL 2

Expert Comment

by:EbenBrooks
ID: 1112265
I'm not sure what you mean for "all the variety," because there are a great number of shades of blue between Cyan (R0,G255,B255) and Purple (R255,G0,B255). A pure blue would be R0,G0,B255), and a dark blue would be R0,G0,B127. What precisely are you looking for?
0
 

Author Comment

by:ciri
ID: 1112266
I would like to get all the shades of blue (including the extremes: cyan purple, pure blue...). I hope it was possible using an equation that connect all the variables (red, blue and green). I have an application that loads an image. In this image I want to distinguish the portions in blue, but not a concrete blue (I want all the shades of blue). If I set in this variables, for example, R0, G255 and B255, I only see Cyan. My code is (in C) like the following:

  for(y=0;y<heigth(image);y++)
  {                                                     //two sentences "for" cover all the image
       for(x=0;x<width(image);x++)
      {
           if ((pLine[x*4+RGBA_RED] == 0)
              &&(pLine[x*4+RGBA_GREEN] ==255)
              &&(pLine[x*4+RGBA_BLUE] == 255)) //cyan
          {
                                       //show this pixel
                                      //with this code I only show cyan
                                     // i want a relation tha let me show all the shades of blue
                      }
      }
  }

Thanks.
0
 

Author Comment

by:ciri
ID: 1112267
Adjusted points to 60
0
 
LVL 2

Accepted Solution

by:
EbenBrooks earned 60 total points
ID: 1112268
Oh! I see what you mean.

For a color to fall into the range you specified, the value of Blue must always be equal to or greater than the values of Red and/or Green. If Blue is equal to the value of either Green or Red, then it CANNOT be equal to the other!

For instance: R254, G254, B255 is a shade of blue. It's very, very close to white, and may be indistinguishable by the human eye. At the same time, R254, G255, B255 is a shade of cyan of similar brightness.

If you want to make sure you're only including the values of blue that are distingushable as blue to the human eye, do this:

The value of Blue must be equal to or greater than the values of Red and/or Green.

If the value of Blue is equal to the value of either Red or Green, then the value of the other (Red or Green) must be 20-30 points below the value of Blue.

This should give you all the visible values of blue.

Hope this helps!

--Eben
0
 

Author Comment

by:ciri
ID: 1112269
Your answer is excellent!!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Picture Branding 5 151
Photoshop Jpeg 12 194
CorelDraw X7 photo printing on 4x6 6 60
Convert SVG to PDF 5 72
I've been using this technique since Adobe CS2, and it should work with any version of Illustrator that includes the appearance panel. In this tutorial we'll create a button using the appearance panel in Adobe Illustrator, and then save it as a r…
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
Learn the basics of inputting and editing your text components in Prezi. We will cover how to set styles, position, and group your text components. In your Prezi editor, click anywhere on the canvas to add text: A flashing cursor informs you that yo…
Learn how to use the remote presentation tool in Prezi to allow you to harness the power of this cloud based presentation platform. You can show your presentation with a remote audience using this free tool.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now