If you want to encrypt your image, I highly recommend you not encrypting each pixel.
The better way is to handle the image as raw binary data and encrypt this:
Encrpytion:
Image -> Save To Stream -> Write Stream to CryptoStream -> Save CryptoStream wherever you want
The decryption is the other way round.
Maybe this article
this article[
^] can help you.
The only problem is, that you cannot display the encrypted data as image since it is (nearly random) binary data.
Maybe
this[
^] could help then.