In C++
Program pixelate.cpp will be pixelating the input image Example One way to pixelate an image is to effectively make every 2×2 non-overlapping window contain the same value (averaged over all the plixels in that window of the input). For example, the following image 10 20 30 40 11 21 31 41 12 22 32 42 13 23 33 43 should be transformed to: 16 16 36 36 16 16 36 36 18 18 37 37 18 18 37 37 where the 16 was computed by averaging 10, 20, 11, and 21 (after rounding), and so on. For simplicity, assume that the width and the height of the image are even numbers, so the picture is divisible into small 2×2 squares, like in the example above.