Hi dear all i am new in java i don't know how identify the background and foreground color of image if any have idea please help thanks in advance

Recommended Answers

All 2 Replies

You can read the image into an Image object, then use the PixelGrabber class to examine the individual pixels and get their colors, but after that it gets difficult - how exactly would you define "background color" and "foreground color" for some arbitrary image?

You said your new to Java. If thats the case then I would definately recommend not starting out with such an ambitious project.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.