for example, I have a 3D image in grayscale, 512X512X300.
I just want to compress it in X and Y plane.
I want 4 pixels to combine into one pixel.
And the value of the combined pixel takes average on that 4 pixels or take its max.
Can I directly do on 3D image? If not, please tell me how to do it on 2D image.