Not a script but i wonder if exporting as a bmp would suffice.
![[Image: XEr0unz.jpg]](https://i.imgur.com/XEr0unz.jpg)
5 bits per channel (+ alpha bit)
Make an image with the colours you use, export, re-open, create palette from image.
![[Image: XEr0unz.jpg]](https://i.imgur.com/XEr0unz.jpg)
5 bits per channel (+ alpha bit)
Make an image with the colours you use, export, re-open, create palette from image.