Sahih al-Bukhari Book 77, Hadith 178
that he had bought a slave whose profession was cupping. The Prophet (ﷺ) forbade taking the price of
blood and the price of a dog and the earnings of a prostitute, and cursed the one who took or gave
(Riba') usury, and the lady who tattooed others or got herself tattooed, and the picture-maker.
(the wife of the Prophet) I bought a cushion having pictures on it. When Allah's Messenger (ﷺ) saw it, he stopped at the gate and did not enter. I noticed the signs of hatred (for that) on his face! I said, "O Allah's Messenger (ﷺ)! I turn to Allah and His Apostle in repentance! What sin have I committed?" He said, "What about this cushion?" I said, 'I bought it for you to sit on and recline on." Allah's Messenger (ﷺ) said, "The makers of these pictures will be punished (severely) on the Day of Resurrection and it will be said to them, 'Make alive what you have created.'" He added, "Angels do not enter a house in which there are pictures."
I heard Muhammad saying, "Whoever makes a picture in this world will be asked to put life into it on the Day of Resurrection, but he will not be able to do so."