function img = myExpand2D(im)

g_filter = [1 4 6 4 1]/16;

img_size = size(rgb2gray(im));
y = zeros(2*img_size);
y(1:2:2*img_size(1),1:2:2*img_size(2)) = im(:,:,1);
img(:,:,1) = 4*conv2(g_filter,g_filter,y,'same');
% img(:,:,1) = y; 

y = zeros(2*img_size);
y(1:2:2*img_size(1),1:2:2*img_size(2)) = im(:,:,2);
img(:,:,2) = 4*conv2(g_filter,g_filter,y,'same');
% img(:,:,2) = y; 

y = zeros(2*img_size);
y(1:2:2*img_size(1),1:2:2*img_size(2)) = im(:,:,3);
img(:,:,3) = 4*conv2(g_filter,g_filter,y,'same');
% img(:,:,3) = y; 

% figure; colormap(gray(256)); imshow(img); title('expanded image');

% img2 = convolve2D(img2);
img = uint8(img);
end