Scripting - how can I find the brighest RGB value of an image

769 views4 repliesLast post: 7/19/2004
Hello group

I am looking for any solution that will tell me what the RGB value of the brightest pixel inside an image is.

I thought I could achieve this with applescript, but it looks like applescript will have have to sample every single pixel and do some heavy number crunching to work it out.

Any leads on how I can achieve this?
#1
On 16 Jul 2004 19:05:50 +0800, Bob Whatsima wrote:

Hello group

I am looking for any solution that will tell me what the RGB value of the brightest pixel inside an image is.

I thought I could achieve this with applescript, but it looks like applescript will have have to sample every single pixel and do some heavy number crunching to work it out.

Any leads on how I can achieve this?
Not sure if this would help at all.... Ever try threshold on a dup layer until the pixels are but a scant few then use as a color select? te number crunch would be much smaller if at all possible.
#2
In article <20040716190550676+>,
Bob Whatsima wrote:

I am looking for any solution that will tell me what the RGB value of the brightest pixel inside an image is.

I thought I could achieve this with applescript, but it looks like applescript will have have to sample every single pixel and do some heavy number crunching to work it out.

Any leads on how I can achieve this?

I've never tried anything like this, so this is sheer speculation -- but is there any way AppleScript can get at the Histogram function? If so, it might be able to 'walk' through the levels from 255 downward, and report the first non-zero pixel count it finds.

--
Odysseus
#3
ZONED! wrote:
On 16 Jul 2004 19:05:50 +0800, Bob Whatsima wrote:

Hello group

I am looking for any solution that will tell me what the RGB value of the brightest pixel inside an image is.

I thought I could achieve this with applescript, but it looks like applescript will have have to sample every single pixel and do some heavy number crunching to work it out.

Any leads on how I can achieve this?
Not sure if this would help at all.... Ever try threshold on a dup layer until the pixels are but a scant few then use as a color select? te number crunch would be much smaller if at all possible.

Yep, this works like a charm, and also to find the darkest bits. If you shift click on the lightest & darkest bits in this way and then cancel the Treshold tool you can fire up curves or levels and use the black and white eyedroppers to easily mark the blackpooint and whitepoint. An easy way to enhance many a photo that uses less than the entire brightness spectrum available!
Pjotr
#4
My newsreader went on the blink, but thanks for the answers. Yes I was able to get a histogram dump after much trial and error. Merci for suggestions ZONED, Pjotr and Odysseus.
#5