Ruling on making sweets and the like in the shape of animate beings, and on selling them
Question

What is the ruling on making sweets and cakes in the shape of animate beings, and the ruling on selling them?
Praise be to Allah.It is not permissible to make sweets or cakes and the like in the shape of animate beings, because of the general meaning of the hadiths which indicate that it is haram to make such images, such as the hadith in which the Prophet (blessings and peace of Allah be upon him) said: “Every image maker will be in Hell, and for every image that he made, a soul will be created which will punish him in Hell.” Narrated by Muslim (2110).
It was narrated that ‘Abdullah ibn Mas‘ood (may Allah be pleased with him) said: I heard the Prophet (blessings and peace of Allah be upon him) say: “The people who will be most severely punished on the Day of Resurrection will be the image-makers.” Narrated by al-Bukhaari (5950) and Muslim (2109).
The scholars of the Permanent Committee for Ifta’ said:
The reason for the prohibition on making images is the fact that it is making images of animate beings, whether they are carved or painted on walls or printed on a cloth or paper or they are woven, and whether they are made with a brush or pen or a device, and whether they are images of something real or something imaginary, or they are small or large, or they are made beautiful or ugly, or they are made with lines representing the skeleton, the reason for the prohibition is the fact that it is something that depicts an animate being, even if the image comes from the artist’s imagination and depicts historical figures such as the pharaohs, or commanders and troops of the Crusades."(Fataawa al-Lajnah ad-Daa’imah  1/696).
The scholars have stated that it is haram to make images, even if they are made of sweets and the like.
Ad-Dardeer said in ash-Sharh al-Kabeer (2/337-338).
It is haram to make images of animate beings, whether they are rational or otherwise, if the image includes all of its body and if the image is lasting. This is according to scholarly consensus. This also applies to images that are not lasting, according to the more correct scholarly view, such as making an image on the skin of a melon. End quote.
Al-Qalyoobi said in his Haashiyah: It is not valid to sell images and crosses, even if they are made of gold or silver or sweets."(Haashiyat al-Qalyoobi  2/198).
Based on that, it is haram to make images out of sweets and it is haram to sell them.
And Allah knows best.