Karl,
AFAIK this needs to be different for various graphic types. Given that one 'knew' the encoding for the specific graphic type, one might need up do an un-pack process before the replacement.
The actual process/function is just an itterative search and replace.
Long awat and far ago (in the days of DOS) there was a commercially available publication which gave the schemes used to encode the more common graphics endcoding schemes. I have long since lost my copy (I think it went with my son?) As I recall, there were over 200 different schemes at that time, some with numerours variations.
MichaelRed
redmsp@erols.com
There is never time to do it right but there is always time to do it over