optimised some image operations

some operations can be done with minimal or no data. eg: Invert

they use more memory in short term, which is garbage collected, and less in the long term.