Are you suppose to collect all the colors uses by an image & put them into different segment accordingly? If so, then open image into binary format & create four matrix of R,G,B & O (offset values) considering each of them as a segment. Put each RGB values into corresponding martix. Thats all I guess. If your requirment is somthing else, then im :doh: