Segmentation of optic disk (OD) is a very important step in automatic Diabetic Retinopathy screening. In this paper, we presented a robust and novel template matching algorithm for automatic detection of OD in retinal images. The size of OD area depends on camera field of view and image resolution. Based on these criteria we formulated and presented OD size estimation algorithm and it is used to create a specific size template. We have used the histograms of color planes instead of complete OD image during template creation. Finally, created templates were used for detection of OD using template matching. The proposed system is evaluated on retinal images of DRIVE database having normal and diseased images. The proposed method has achieved an OD detection success rate of 95%. The performance comparison results with other methods show that the proposed algorithm is fast and robust for the detection of OD in the retinal images with and without pathology.