Metasurfaces, enabling effective optical modulation of incident lightwave, can be employed as a promising candidate to implement different functions, thus significantly improving the lightwave controllability, validity and system integration. In this paper, the phase and intensity modulation, firstly, of the incident lightwave based on a single nanotip was researched. Then, the metasurface consist of nanotips with different structural parameters was designed according to the grayscale image obtained via diffractive network encoding, so as to realize the extending image depth of field. We demonstrate that the metasurface based on the nanotips antenna can achieve a large image depth range of field exceeding 50μm. Moreover, the maximum focal length can reach ~200μm after passing through the arrayed nanotips.