How to Downsample image in both Horizontal and Vertical Direction

Illustration
Delilah - 2021-03-04T13:46:31+00:00
Question: How to Downsample image in both Horizontal and Vertical Direction

Any one help me how to downsample image in horizontal direction and vertical direction.   i used downsample(image,4), it will down sample image in both the direction, but i need to downsample separately for horizontal and vertical.

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

For grayscale:
 
 
Xdown = X(1:2:end,1:2:end);

If it's RGB, keep the third dimension:

Xdown = X(1:2:end,1:2:end,:);


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!