The encoding field of the Image message (mostly) tells you the format of data[]. There is a list of pre-defined strings, where bgr8 is probably the most common.