>>1281838It's not quite the same effect.
Here's a little script that does what you want:
https://dpaste.com/BU32WLQ6EI generated picrel with it.
You'll need Python, numpy and Pillow.
You can either change the values of INPUT and OUTPUT, or run it with arguments:
> python rainbow.py input.png output.gif