RLE encode image