How to show numbers on the borders of contours in ContourPlot?

Consider

ContourPlot[Cos[x/4] + Cos[y/4], {x, 0, 4 Pi}, {y, 0, 4 Pi},
PlotLegends -> Automatic]


The output is

How can I put numbers on the borders of each contour, so that I don't need the legend bar? If possible, I'd like to know how to customize the color of numbers, so that they are easily visible.

• Add the option ContourLabels->True? May 8 '18 at 18:12
• How to adjust the color, size, and position of numbers? May 8 '18 at 18:54
• also related: Label some contourplots individually and Colour of contour labels
– kglr
May 8 '18 at 19:16

g = Cos[x/4] + Cos[y/4];