Question

Been playing with StudioJS wrapper for ImageResizer. Can ImageResizer adjust the white balance relative to a color? Ultimately, I want the user to be able to click an area in the image that should be white, and the rest of the image adjusts.

I see the Auto Balance functionality that uses the AdvancedFilters plugin, I guess I want to take it a step further.

Was it helpful?

Solution

No, ImageResizer doesn't current support adjusting relative to a color. However, if you wanted to implement said feature, it would not be difficult.

You could modify AdvancedFilters.cs, inserting an IF statement near line 150, and add support for a new command, such as "&a.white=rrggbb".

Simply provide the RGB values to the LinearLevels class to perform the scaling on the image. http://www.aforgenet.com/framework/docs/html/29bf1191-47c9-314b-eb8d-bea3f903ac28.htm

If you like the result, and want to share it, send me a pull request on GitHub or e-mail me the code snippet. If it passes testing, it might make it into the next release.

Client side, you might find this library helpful for selecting a color from an image.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top