The other person never came back to provide a link or other information for you. I believe that is the correct answer though most people searching for the movie do not mention the magic paintbrush.
"The Peanut Butter Solution" aka "Opération beurre de pinottes" (1985)
From Wikipedia synopsis:
The art teacher at Michael's school, simply called the Signor, frightens children and forbids them from using their imagination. After getting fired from the school, the Signor finds out about Michael's condition and kidnaps him and many other neighborhood children to make magic paint brushes from Michael's ever-growing hair, in which he subdues Michael with a knockout drug. The kidnapped children are put to work under tough conditions. "We have to make 500 brushes a day, or we don't eat!" The paintbrushes are so powerful that they paint whatever their user imagines. Connie and Michael's sister, Susan, discover the Signor's magical paintbrush factory and try to rescue Michael. Connie tries to use force, but he is overpowered by Signor and his dog James. Instead, Connie tricks the Signor into painting a picture of the abandoned mansion. Connie then dares him to investigate inside, leading "The Fright" to be passed on from Michael to the Signor. Signor, now bald, escapes from the haunted house and chases the children, locking them up. Just as Connie is about to escape with Michael, Susan and their dad find the factory and the Signor is arrested by the local police. The film ends with the family reunited as the mother has returned home, and Michael's hair has stopped growing out of control.
You can read the rest of the summary here: