Lighting ,darking,Inverting color of Timage!

How to implement the comman operations of images!