Quickest way to find the darkest pixel in an image

I was wondering what the absolute fastest way to grab the darkest pixel(grayscale) in a picture. Or if anyone could give me any ideas on how one would go about making a fast dark pixel finder.
[199 byte] By [ChromoXNHa] at [2007-11-15]
# 1
Iterate through all the pixels in the image. It's not going to be extremely fast.
CaptainMorgan08a at 2007-7-12 > top of java,Security,Cryptography...
# 2
Is there no special like pointers or something I can use to get at the raw image.
ChromoXNHa at 2007-7-12 > top of java,Security,Cryptography...
# 3
[url] http://java.sun.com/j2se/1.5.0/docs/api/java/awt/image/BufferedImage.html#getRGB(int,%20int)[/url]
CaptainMorgan08a at 2007-7-12 > top of java,Security,Cryptography...
# 4

Is the image Greyscale or RGB?

Either way - you can access the data by getting the Raster

Raster r = image.getData()

Lookup the methods on Raster - you can access the data as one array.

If the image is RGB - you will have to convert it to a Greyscale value (you let the JVM do it by creating a new Greyscale image and drawing to it, or doing it yourself by access each one and performing the math)...

Lemme know...

equilibrica at 2007-7-12 > top of java,Security,Cryptography...
# 5
Is using the raster quicker than useing the getpixel method?
ChromoXNHa at 2007-7-12 > top of java,Security,Cryptography...