function A2 = gray_blowup ( A1, f )

  [ m, n ] = size ( A1 );

  A2 = uint8 ( zeros ( f*m, f*n ) );

  for i = 1 : m
    ilo = ( i - 1 ) * f + 1;
    ihi = i * f;
    for j = 1 : n
      jlo = ( j - 1 ) * f + 1;
      jhi = j * f;
      A2(ilo:ihi,jlo:jhi,1:o) = A1(i,j);
    end
  end

  return
end