YANGON, Myanmar — A bar manager from New Zealand and two Burmese men were sentenced to two years in prison in Myanmar on Tuesday for posting an image online of the Buddha wearing headphones, an effort to promote an event.

The court in Yangon said the image denigrated Buddhism and was a violation of Myanmar’s religion act, which prohibits insulting, damaging or destroying religion. “It is clear the act of the bar offended the majority religion in the country,” said the judge, U Ye Lwin.

The image was posted in December on the Facebook page of the VGastro bar and restaurant in Yangon. After an outcry from hard-line Buddhist groups, the police arrested the restaurant’s general manager, Philip Blackwood, 32, of New Zealand, along with the bar owner, U Tun Thurein, 40, and the manager, U Htut Ko Ko Lwin, 26. The three have been held in Insein prison in Yangon.

In addition to the two-year prison term for violating the religion act, the three were also sentenced to six months for illegally operating a bar after 10 p.m. Mr. Blackwood said after the verdict that the men had expected they would be convicted.