Printers that churn out confectionery rather than paper documents have gone on display at the world's largest consumer electronics show.

The 3D printers can produce sweets using chocolate or sugar flavoured with vanilla, mint, sour apple, cherry and watermelon flavours and are capable of creating complicated shapes that are usually difficult to mould.

At present 3D printers are more often used for creating design prototypes and models using plastics and metal.

The smaller, countertop Chefjet can only produce monochrome creations but the bigger and more expensive Chefjet Pro can churn out treats in full colour using an inkjet head filled with food colouring instead of printer ink.

Technology company 3D Systems is displaying the machines at the International Consumer Electronics Show (CES) in Las Vegas, Nevada. Both printers are expected to go on sale in the second half of the year, with the Chefjet priced at 5,000 US dollars (£3,034) and the Chefjet Pro at 10,000 US dollars (£6,068)

Kyle von Hasseln, the co-founder of Sugar Labs, who designed the prototypes for the printers, said they would one day be in family homes.

Standing in front of a printer creating a chocolate sculpture, he added: "These are the very first commercially-certified, kitchen-ready 3D food printers.

"We spread a very fine layer of sugar and cocoa powder and an inkjet head that is just like the one in a desktop 2D printer squirts out cocoa butter and makes chocolate in real time and creates a chocolate sculpture in real time.

"The geometry is very precise and very mathematical and that is traditionally a very difficult thing to do with frosting or chocolate, and can't be done with a traditional mould. We can make interlocked shapes which is a very exciting possibility for candy."

He added: "One day they will definitely be in homes, these first ones are commercially-certified professional printers for bakeries and restaurants.

"But any kind of food is very possible to 3D print, anything that can be powderised and printed, so savoury is in the future for everyone."

The printers will be accompanied by a Digital Cookbook to help customers make the sweets..

The American-based company 3D Systems already produces printers for plastics, metals and ceramics.