How to translate a RAW pixel image?

I tried to gain experience in working with the Hexham and writing unpacker.
Almost all won but faced with such a problem, the game developers have Packed all textures in raw form without headings.
Ultimately, I have the fine resolution of textures, the estimated chromaticity and the set of bytes with the pixels. The pixels themselves are stored in the byte array. I wanted to bring them to the form, and then just fucked in jav'e, I can not understand how to translate these bytes into pixels with a normal color.
I guess that must be something like this:
1) Create an object which represents the image with the resolution and color.
2) Give an array of bytes this picture putting the color palette.

Or you will have to parse manually the whole array, write Converter palettes and pens to create a certain output format(png for example)?
Tell me or send the article to the owner where a similar problem was solved. Seems to not need it, but very interesting =)
If anyone is interested the excavations of the format view you can see here, there is also a template for the 010 editor and unpacking my(sorry for recapctha).
July 8th 19 at 11:31

Find more questions by tags ImagesJava