changes in subtitles, added mask_to_rgb to write_gif, corrected doc