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 4065898
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:04:20+00:00 2026-05-20T16:04:20+00:00

I think the the title is self explanatory. Although I search actually for the

  • 0

I think the the title is self explanatory. Although I search actually for the blackest and reddest pixel by columns, I guess answering the first automatically answers the second.

  • 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-20T16:04:20+00:00Added an answer on May 20, 2026 at 4:04 pm

    Assuming that your bitmap stores colors in RGB color format (not YCbCr or CYMK) and further assuming that 8 bits are used per color component, the pixel closest to (0,0,0) is the blackest and the pixel closest to (255,0,0) is the reddest. Assuming that this is not really new information to you, I guess your question is rather how to calculate "the distance", so you can find out which one is the closest, correct?

    To find out what the blackest pixel is, RGB might not be an optimal color representation; I’d prefer HSL for that. A pixel in HSL format consists of three values, H is the hue (the base color), S is the saturation (how much "gray" is mixed into the color) and L is the lightness (basically the brightness). The pixel with the lowest L value (L is between 1.0 and 0.0) would then be closest to black; two pixels with different H/S values, but same L value are equally "black", even though they might have different colors.

    To find out which pixel is closest to red, you’d compare the HSL values of the pixels and search for the pixel with a H value closest to 0.0 degree (since 0.0 degree is red and H is between 0.0 and 360.0 degree, however 360.0 degree equals 0.0 degree), an S value closest to 1.0 (since 1.0 means full color, while 0.0 means fully gray) and an L value closest to 0.5 (since 0.0 would be black and 1.0 would be white).

    E.g. in HSL dark yellow is 49.5/0.893/0.497, dark blue is 248.3/0.601/0.373, so you can clearly see that the dark blue pixel has a brightness (= lightness) of 0.373, the dark yellow one of only 0.497, thus the dark blue one is definitely "darker" than the yellow one (closer to black), which solves your first question.

    Which pixel is redder? Red is 0.0/1.0/0.5. You can calculate for each component how much it is off of the ideal red pixel. Whether you "weight" all components equally or whether you consider hue (color) difference as more important than other differences (and by what factor) is rather up to your definition of red. You can exclusively go by hue if you want.

    This page has a nice recipe on how to convert RGB step by step to HSL (and back again, if you have to):
    http://130.113.54.154/~monger/hsl-rgb.html

    To give you an idea of how the HSL color space looks like, here are some pictures from Wikipedia that try to visualize this color space:

    http://upload.wikimedia.org/wikipedia/commons/a/a0/Hsl-hsv_models.svg

    HSV is an alternative color space that shares some properties with HSL, however I personally prefer HSL. Both use the same definition of hue H, but they use very different definitions of saturation and thus also a different definitions of lightness/brightness.

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

Sidebar

Related Questions

I think the title is self explanatory. What I'm looking for is material so
I think the title is fairly self explanatory, but to give a little context.
I think the title is self explanatory.
I think the title is self-explanatory. Many times I have small typos and I
i think the title is pretty self explanatory. I have many divs generated from
title is self explanatory i think.. is there anyway to make a list of
I think the title is self-explanatory. Would be handy for large files with lots
I think the title is rather self explanatory but just to clarify I am
I think the title is self-explanatory. What needs to happen is that when a
I think the title is self explanatory. I am making a program and I

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.