Output an image from a modified imagelevel pixel?

How to output an image from a modified imagelevel pixel?

I AM NOT BEING ABLE TO PUT THE LINES OF THE PROGRAM