Is a painting a primary source?

Yes, if the painting originated at the time it depicts, then it is a primary source. For instance, Da Vinci's Mona Lisa is a primary source because it is the most famous art piece during the Renaissance period. Works of art, in general, are considered primary sources. However, in some cases, paintings are considered secondary sources.

If the painting was not created under the time it reflects, then it is a secondary source. The mocking replica of the Mona Lisa by Marcel Duchamp in 1919 is a good example. Duchamp painted the Mona Lisa from his perspective and gave it a new definition. When researching about Mona Lisa, Duchamp's work would be considered a secondary source because he took the original primary source and added some hairy details to give it a new meaning.

L.H.O.O.Q. by Marcel Duchamp, 1919
L.H.O.O.Q. by Marcel Duchamp (1919) is considered to be a secondary source when researching about Mona Lisa. Image source:

At the same time, Duchamp reveals an ambiguity of gender within Leonardo's aesthetic. If the scope of the research was about androgynous paintings of the early 20th century, then L.H.O.O.Q. can be used as a primary source.

Similarly, if you were to research iconic paintings of the Dada movement, L.H.O.O.Q. would be an ideal example. Duchamp’s revolutionary version of the Mona Lisa checks all the boxes of Dadaism, making the painting a primary source for such a research. Depending on the angle you take of a painting, it can either be a primary or secondary source.