Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6474561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:36:04+00:00 2026-05-25T06:36:04+00:00

I am looking for some ideas about an approach that will let me analyze

  • 0

I am looking for some ideas about an approach that will let me analyze an image, and determine how greenISH or brownISH or whiteISH it is… I am emphasizing ISH here because, I am interested in capturing ALL the shades of these colours. So far, I have done the following:

I have my UIImage, I have CGImageRef and I actually have the colour of the pixel itself (it’s RGB and Alpha), what I don’t know is how to quantify this, and determine all the green shades, blues, browns, yellows, purples etc… So, I can process each and every pixel, determine it’s basic RGB, but I need some help in quantifying the colours it over a whole image.

Thanks for your ideas…
Alex.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:36:05+00:00Added an answer on May 25, 2026 at 6:36 am

    One fairly good solution is to switch from RGB colour space to one of the Y colour spaces, such as YUV, YCrCb or any of those. In all cases the Y channel represents brightness and the other two channels together represent colour, relative to brightness. You probably want to factor brightness out, possibly with the caveat that all colours below a certain darkness are to be excluded, so getting Y separately is a helpful first step in itself.

    Converting from RGB to YUV is achieved with a simple linear combination. Straight from Wikipedia and a thousand other sources:

    y = 0.299*r + 0.587*g + 0.114*b;
    u = -0.14713*r - 0.28886*g + 0.436*b;
    v = 0.615*r - 0.51499*g - 0.10001*b;
    

    Assuming you’re keeping r, g and b in the range [0, 1], your first test might be:

    if(y < 0.05)
    {
        // this colour is very dark, so it's considered to be as
        // far as we allow from any colour we're interested in
    }
    

    To decide how close your colour then is to, say, green, work out the u and v components of the green you’re interested in, as a proportion of the y:

    r = b = 0;
    g = 0;
    
    y = 0.299*r + 0.587*g + 0.114*b = 0.587;
    
    u = -0.14713*r - 0.28886*g + 0.436*b = -0.28886;
    v = 0.615*r - 0.51499*g - 0.10001*b  = -0.51499;
    
    proportionOfU = u / y = -2.0479;
    proportionOfV = v / y = -0.8773;
    

    Subsequently, work out and compare the proportions of U and V for incoming colours and compare (e.g. with 2d planar distance) to those you’ve computed for the colour you’re comparing to. Closer values are more similar. How you scale and use that metric depends on your application.

    Notice that as y goes toward 0, the computed proportions become increasingly less precise because of the limited range of the input data, and are undefined when y is 0. Conceptually that’s because all colours look exactly the same when there’s no light on them. Checking that y is above at least a certain minimum value is the pragmatic way of working around this issue. This also means that you’re not going to get sensible results if you try to say “how black is this picture?”, though again that’s because of the ambiguity between a surface that doesn’t reflect any light and a surface that doesn’t have any light falling upon it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm seeing a weird error message and am looking for some ideas as to
I looking for some information about the difference of the different session types available
I am looking for pointers, suggestions, links, warnings, ideas and even anecdotical accounts about
I am looking for some ideas as to how to branch my application so
I've tried looking for some information about a query I'm trying to write and
I'm looking for some advice/feedback about using different languages in a layered architecture. Right
I'm fiddling with a bit of c++/opencv. I was looking some of the samples
Looking for some advice on the best way to implement localization along with client
Looking for some guidance on a WCF service I’m prototyping. I have a WCF
Looking for some resources on SOA / BPEL best practices. Specially BPEL.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.