Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to replace color of an image?

I want to replace color of an image. For example turn all blue colors to red without any distortion on shape. When i try this i can swap the colors by iterating every pixel, however the shape of the swapped area turns into a flat shape.

example1 input : http://www.tutorialwiz.com/tutorials/changing_color/images/original.jpg
example1 output: http://www.tutorialwiz.com/tutorials/changing_color/images/3.jpg

example2: input output together : http://www.digital-photography-school.com/wp-content/uploads/2009/07/before-after.jpg

like image 203
Tony Avatar asked Mar 10 '11 19:03

Tony


1 Answers

The usual way to do this is to use an RGBImageFilter. See the docs for FilteredImageSource for how to use such a filter.

like image 105
Ted Hopp Avatar answered Oct 24 '22 21:10

Ted Hopp