Painting any type of metal surface can be challenging. Because metal is hard and nonporous, it is not an ideal surface for paint adhesion. Magnesium metal is especially difficult to paint because it must be deoxidized and pretreated first. In addition, only specific types of paint should be used to coat this type of surface or the finish coat will chip and peel rather quickly. If you need to paint magnesium metal, you need to know the proper preparation steps and the correct materials to use or you could have disastrous results
Degrease the magnesium by scrubbing it with an alkaline cleanser.
Apply a chromic acid treatment. Follow the directions on the chromic acid treatment kit carefully to avoid accidental burns.
Neutralize the acid as directed by the labeling that came with your specific kit. Rinse the surface and allow it to dry.
Apply blue painter's tape to areas you don't want painted.
Apply a zinc chromate spray primer. Allow the surface to dry for two hours.
Apply a zinc chromate spray paint in the same manner as you did the primer.