I'm working on color-balancing images with as little input from the user of my app as possible, specifically to remove color casts caused by scanning aged paper. Photoshop's Auto Color action works great, with no input at all, but I don't even know where to begin in implementing something like that.

Where can I find an example of how to do that? I've done extensive searching and haven't found a good example. To see the correction I'm talking about, take a look at this question on Stack Overflow.

  • $\begingroup$ have you considered using an existing library for it? I'm sure there are dozens of image processing libraries tools or plugins that already exist. Look for something like "Java image processing libraries" $\endgroup$ – CyberMen May 21 '15 at 18:48
  • $\begingroup$ @CyberMen Thanks. I've tried finding something for Cocoa, but there aren't many, since the built-in Core Image framework does so much. I wouldn't even know how to start getting a Core Image filter together that would do this, though. $\endgroup$ – Dov May 21 '15 at 19:57

Photoshop's Auto Color is nothing more than Histogram Equalization.

It has some improvements over the classic Histogram Equalization by adding a threshold of not touching the % at the extreme values.

Try it and see for yourself:

Good Luck.

| improve this answer | |
  • $\begingroup$ Thanks - do you have any links for examples of how to perform Histogram Equalization? I found this link earlier, but it didn't give examples of how to generate or use a histogram in code: quora.com/How-does-Photoshops-auto-color-work $\endgroup$ – Dov May 22 '15 at 19:41
  • $\begingroup$ @Dov, I added few links which will assist you to code it. $\endgroup$ – Royi May 23 '15 at 13:58
  • $\begingroup$ Photoshop's Auto Color is not a Histogram Equalization. It is done as a linear map, so the goal is not to get a constant histogram at the end. . $\endgroup$ – Ivan Kuckir Jun 6 '18 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.