Pick some works from sixel-for-Xquartz branch