EDIT: Finally, I figured out what’s wrong with the colors. So, irrelevant part of post is gone.
EDIT: It is uploaded to g’mic community. And here’s a sample image. It uses indexing, and no apply_tiles.
^Also works with transparency too.