Photoshop: Finding the Darkest & Lightest Pixel with One Click

  • 2
  • Idea
  • Updated 2 years ago
  • (Edited)
Is it really true there's still no way to find the color values for the darkest or lightest pixel of the image with one click? Programmatically, this is a basic level task, and compared to that manual workarounds to do this are relatively tedious.

Preferably, I'd like to use this by pressing down some extra key(s) on the keyboard, while clicking on the image with the eyedropper tool.
Photo of Samuli Viitasaari

Samuli Viitasaari

  • 31 Posts
  • 2 Reply Likes

Posted 6 years ago

  • 2
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 818 Reply Likes
Correct, there is no one click way to do that.
You can read the histogram palette, or use the levels dialog to do so.

But it is not a common workflow issue, and has not been requested before - except by users doing image analysis who have their own plugins to readout the values they need.
Photo of Samuli Viitasaari

Samuli Viitasaari

  • 31 Posts
  • 2 Reply Likes
Hi Chris, and thank you for your quick answer. It could be that the *workflow issue* isn't common, but as a graphic designer I would like to point out, the *workflow* itself is very common. People have found workarounds for this, but this doesn't mean they wouldn't use the easy way if it existed.

A practical example. You have a CMYK photo, and you need to place it on a black background – either a background layer in Photoshop, or for example a vector background in Indesign or Illustrator.

As we know, 100K black will in most cases look pale and gray compared to the blacks in the photo, so we use rich black instead. And a common way to find suitable rich black color values is to look for the darkest color in the photo. Since we don't have the forementioned tool, we hover around the dark areas of the photo with the eyedropper, compare the values to find out a value close enough to the actual darkest pixel, and use that. But what we actually needed, was the actual darkest color value as quickly as possible – the workarounds are just more tedious ways to achieve a result 'close enough' to what we actually want.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 818 Reply Likes
Most people just use the levels dialog to find the darkest color regions, then click with the eyedropper.
Photo of Samuli Viitasaari

Samuli Viitasaari

  • 31 Posts
  • 2 Reply Likes
Right. Well, thanks for your time. I'm off to search for a suitable plugin.
Photo of Martynas Petrauskas

Martynas Petrauskas

  • 1 Post
  • 0 Reply Likes
Samuli did you find a plugin that does the job?
Photo of Samuli Viitasaari

Samuli Viitasaari

  • 31 Posts
  • 2 Reply Likes
Now that I think of it, this would work best as a plugin/action that would simply add two color samplers to the image; one on the darkest and one on the lightest pixel. This way you could see the values for both simultaneously in the info palette, and also their locations on the image.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 815 Reply Likes
yes, JavaScript isn't supposed to have direct access to pixels - it's not for image processing, just automation.
Photo of Samuli Viitasaari

Samuli Viitasaari

  • 31 Posts
  • 2 Reply Likes
Ok, so this can't be done well with scripts. Then, how many votes do I approximately need for this feature to be considered? I really want this feature, and I'm balancing between the effort of developing a plugin for it versus getting attention for this idea.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 815 Reply Likes
Oh, it can still be done with scripts - it's just that reading the image pixel by pixel isn't a good way to do it. Scripts can get the histogram.
Photo of Samuli Viitasaari

Samuli Viitasaari

  • 31 Posts
  • 2 Reply Likes
Ok, thanks for the tip... so I assume I could then grab the values from the histogram and set them as the current foreground and background colors, for example. This would be good enough for me, and still doable with my humble coding skills.
Photo of Samuli Viitasaari

Samuli Viitasaari

  • 31 Posts
  • 2 Reply Likes
I've now looked a bit into scripting and more specifically, accessing the histogram using JavaScript. I got the impression, that the histogram only provides luminosity 256 levels, dependless of the color depth of the actual image.

Doesn't this mean the darkest nonzero step in the histogram likely represents several of the darkest colors in the image, and not just the absolute darkest color value (I know the term "absolute darkest" has some relativity to it, especially in cmyk mode, but I mean according to the lightness value you get using standard lab conversion)? Or have I misunderstood something – is it still possible to get the RGB, CMYK (or whatever the color mode might be) values for the absolutely darkest color using just the histogram?
Photo of Scott Mahn

Scott Mahn

  • 178 Posts
  • 46 Reply Likes
Like
Photo of Samuli Viitasaari

Samuli Viitasaari

  • 31 Posts
  • 2 Reply Likes
Thanks, Scott! This idea has evolved a bit since my original post, so if you'd like to see the updated version, it's here: http://feedback.photoshop.com/photosh...
Photo of Samuli Viitasaari

Samuli Viitasaari

  • 31 Posts
  • 2 Reply Likes
I would really appreciate a tool, launchable by a keyboard shortcut, that would place a color sampler on the lightest pixel of the image, and another on the darkest one.

In case there was more than one instance of the darkest and the lightest pixel, as an additional functionality you could get two extra layers, one with all the instances of the lightest pixel, and another with the darkest, on transparent background. In this case, the color samplers could be placed on top of the approximate centerpoint of the largest area of said colors.

This quick tool would have several applications:
- Getting the darkest color value to define suitable rich back for the background in Photoshop, Illustrator or InDesign
- Getting the lightest color value to use as a light background
- Getting the locations (and shapes) of the darkest and lightest extremes of the image instantly
- Seeing instantly whether the image is overexposed or underexposed

Alternatively, this tool could be done as a simplified version with no information about the locations of the said darkest or lightest points, simply by adding the image's lightest color as a background color and the darkest one as a foreground color.

This reply was created from a merged topic originally titled
Photoshop: Finding the Image's Darkest & Lightest Color Quickly (enhanced version).
Photo of david lincoln brooks

david lincoln brooks

  • 1 Post
  • 0 Reply Likes
I also was led to this conversation by wanting the same kind of tool.
Photo of Pablo Moreno

Pablo Moreno

  • 1 Post
  • 0 Reply Likes
Old thread, but if this helps, the workaround I found so far is to set a levels adjustment layer in Photoshop and press the 'auto' button , with the auto contrast option as default. and then look in any of the channels RGB in the levels adjustment layer, and you will find the darkest and the lightest  point for every channel . Will work with curves too.

Edit: I need to read this values with a script, anyone??
(Edited)