Image seg

this function seems to be completely unnecessary.  Why not store the data in the array in this form in the first place?