Could i reverse the color of object with background ?

i want to ask, could i change the color ( reverse ) the background color with the object color ?
for example :
<a>[URL=http://imageshack.us/photo/my-images/8/ricef.png/][IMG]http://img8.imageshack.us/img8/101/ricef.png[/IMG][/URL]</a>
Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]

Answers (1)

Sure. If your image data is in the range 0 to 1, replace each pixel value by 1 minus the pixel value. If your image data is in the range 0 to 255, replace each pixel value by 255 minus the pixel value (but make sure the output is the right data class.)

1 Comment

hmm
i have tried this code
I2 = I - background
which is the background is black color
and the I = original image
and the color is averaged
how i can replace the pixel ?
i replace it one by one ?
or can i do it with one step ?
i already fix the image
u can see the image

Sign in to comment.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Asked:

on 9 May 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!