Context. Coronagraphic techniques are required for detecting exoplanets with future Extremely Large Telescopes. One concept, the Apodized Pupil Lyot Coronagraph (APLC), combines an apodizer in the entrance aperture with a Lyot opaque mask in the focal plane. This paper presents the manufacturing and testing of a microdots apodizer optimized for the near IR. Aims. We attempt to demonstrate the feasibility and performance of binary apodizers for the APLC. This study is also relevant to coronagraph using amplitude pupil apodization. Methods. A binary apodizer was designed using a halftone-dot process, where the binary array of pixels with either 0% or 100% transmission was calculated to fit the required continuous transmission, i.e. local transmission control was obtained by varying the relative density of the opaque and transparent pixels. An error-diffusion algorithm was used to optimize the distribution of pixels that approximated the required field transmission. The prototype was tested with a coronagraphic setup in the near IR. Results. The transmission profile of the prototype agrees with the theoretical shape to within 3% and is achromatic. The observed apodized and coronagraphic images are consistent with theory. However, binary apodizers introduce high frequency noise that is a function of the pixel size. Numerical simulations were used to specify pixel size and minimize this effect, and validated by experiment. Conclusions. This paper demonstrates that binary apodizers are well suited for use in high-contrast imaging coronagraphs. The correct choice of pixel size is important and must be addressed by considering the scientific field of view.