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

  • Home
  • SEARCH
  • 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 6059045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:40:01+00:00 2026-05-23T08:40:01+00:00

For example I have a pixel with these values: CGFloat red = 34 //

  • 0

For example I have a pixel with these values:

CGFloat red = 34 // 0 - 255
CGFloat green = 128
CGFloat blue = 190

and I want to increase luminance so that blue is 255.
NOTE: With “Luminance” I mean the L-component of Photoshop in LAB color space. See pictures!

There must be a special formula to compute the RGB values for the increased luminance, because the R G B values are modified in a non-linear way!

Proof: I did a test in Photoshop and created this same color, and then opened the color picker to examine it:

Original color

Then I activated the L component of the LAB color space, which controls luminance (at least that is what I am talking about – I mean the brightness controlled by that L component. Guess that is luminance).

So with L activated, I dragged the slider on the left upwards until B reached 255:
Modified color

Now read the resulting R G B values:

CGFloat newRed = 112 // 0 - 255
CGFloat newGreen = 188
CGFloat newBlue = 255

The differences between these is:

newRed - red = +78
newGreen - green = +60
newBlue - blue = +65

The percentages are:

red shift: +38.42%
green shift: +29.55%
blue shift: +32.01%

This does not correspond with the known formula for computing Luminance out of R G B, which is something close to luminance = (red * 0.3) + (green * 0.6) + (blue * 0.1).

Obviously, they have been shifted in a non-linear manner.

Is there a known way to compute newRed, newGreen, newBlue out of red, green, blue in a similar fashion how Photoshop does it?

  • 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-23T08:40:01+00:00Added an answer on May 23, 2026 at 8:40 am

    So you want to convert an RGB color into the Lab color space? Sure, that’s possible.

    But there are a lot of different standards that are all referred to with the general name “Lab” color. You’ll need to select one to use when writing your algorithm. Photoshop in particular uses the CIELAB D50 standard, so you would want to use that one if you need to accurately simulate its processing.

    Another thing you have to keep in mind is that the RGB model is device-dependent, which means that in order to convert from RGB to Lab, you’ll first need to convert from RGB into some device-independent, absolute color space. Adobe does this with their “Adobe RGB” format, but you can use something standard like sRGB. The adjustment process considers the device-dependence of the RGB color, but transforms the color into one that is device-independent. Once you have that, you can take the last step of transforming the color into the Lab color space.

    The Wikipedia article provides some background information and useful formulas when writing a conversion algorithm. And here’s someone that has already written such a conversion algorithm. And one for MATLAB you could probably convert.

    Depending on how serious you are (so probably not), you could also download the source for GIMP and see how they’ve implemented the conversion algorithms. Their software claims to support the Lab space.

    Be careful, though, when converting back to RGB. The Lab color space can represent colors that are well outside the range of sRGB. Even in Photoshop, most of what you see in Lab mode is discarded once you convert the image back to RGB (or CMYK).


    Edit: It’s also worth considering that if your only goal is to lighten a color in a color space that better approximates human color perception than RGB, you might not need to fuss with Lab at all. Lots of applications do this by converting to either the HSL or HSV color space. (Photoshop calls HSV, HSB).

    The advantage is that you can simply adjust the “Lightness” or “Value” values to alter the intensity of the color (much like you would adjust the “Luminance” value in the Lab color space), but the conversion algorithms are much simpler (and often built into the standard libraries of your language of choice).

    For example, see my answer to this question for a conversion algorithm written in a .NET language.

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

Sidebar

Related Questions

For example I have a value of 103.33 I want to put 100 to
For example I have an application developed on windows mobile 5 and I want
I'm using the Silverlight UnitTest framerwork does anyone have a good example have how
Example: You have a shortcut s to SomeProgram in the current directory. In cmd.exe
Example I have Person , SpecialPerson , and User . Person and SpecialPerson are
Example: I have two shared objects (same should apply to .dlls). The first shared
I have example of code below. <script type=text/javascript src=assets/scripts/somescript.php>. </script> So, will my browser
For example I have such query: Query q = sess.createQuery(from Cat cat); List cats
For example I have 2 tables, Users and UserRelations , and it is a
For example I have a simple class like public class Person{ public int Age

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.