no need for a 6 year old script for a 6 year out of date version of The gimp

the current Gimp 2.8.14 has a cool plugin with a second imaging processing tool
G'mic

the current gmic gimp plugin has a hex maker built into it
http://gmic.eu/
example on a random image of mine