function A=zoomcd3(B);

%B:input color image--nxnx3
%A:interpolated color image by zooming in the color difference images

Bg=B(:,:,2);
Br=B(:,:,1)-Bg;
Bb=B(:,:,3)-Bg;

rAg=edintp1(Bg);
rAr=edintp1(Br)+rAg;
rAb=edintp1(Bb)+rAg;

L=2^8-1;
rAr = round(rAr); 
ind = find(rAr>L); 
rAr(ind) = L; 
ind = find(rAr<0); 
rAr(ind) = 0; 

rAg = round(rAg); 
ind = find(rAg>L); 
rAg(ind) = L; 
ind = find(rAg<0); 
rAg(ind) = 0; 

rAb = round(rAb); 
ind = find(rAb>L); 
rAb(ind) = L; 
ind = find(rAb<0); 
rAb(ind) = 0; 

A(:,:,1)=rAr;
A(:,:,2)=rAg;
A(:,:,3)=rAb;

return;
