I'm trying to compute the pixel value by using the neighboring pixels as input in tiff image

Attached the pixel image. what I want is,

Output Pixel Vaule of cell 5 = 4*Input Pixel value of cell 5 - (Sum of pixel values of cells 2,4,6,8)

How to perform this operation for all the pixels in the tiff image?

If anyone knows about it, please provide the detailed steps to do so using any software/tool.

Thank You

Similar questions and discussions