KHAZER CAMP, Iraq — By the time the jihadists had finished, not even a woman’s eyes were legal. Showing them was a punishable offense.

The dress code imposed on the women of Mosul started soon after the Islamic State overran the city more than two years ago. It was carried out gradually, until every part of the female body was erased, starting with the face, then the rest of the body — including the hands, which had to be covered with gloves, as well as the feet, which had to be hidden by socks. It ended with an announcement blared over loudspeakers, telling women to wear a film of black cloth over their eyes.

Halima Ali Beder, 39, said she had resentfully made each new addition to her wardrobe, starting with the niqab to cover her face, and the abaya, also known as a jilbab, a loosefitting gown. Yet she still ran afoul of the Islamic State’s increasingly harsh enforcement of its codes when she stepped into the lane outside her home, planning to pop over to her neighbor’s house.