Adjust image while changing to indexed color mode

In the meantime, I have created a script to help with this.
See this thread.