I could go down the long rabbithole of figuring out how to call g*mp's image manipulation tools from a commandline or API, or getting imagemagick installed on this PC and figuring out how to port it over there...
or I could be silly and take advantage of the fact that I'm applying gamma ramps to an 8-bit greyscale image. What's the difference between the "before" and "after" images? a different palette.