NOTE: this script has been updated. Read about it in this article.
The gamma settings which are set in the preferences of 3ds max influence the display of colours in the viewport. Max corrects the display of these colors according to whatever setting you might put there. The images in buttons in rollouts and scripts are not corrected. This means pictures in buttons can look either too dark or too light, depending on the gamma setting. There is a way to fix this.
According to the maxscript reference you can’t change the gamma of an image loaded from disk. It’s a read-only property. To work around this, you can set the gamma-setting of the entire application just before you load the image into the button. After the button has been loaded you reset the gamma-setting to whatever value it had. Check out the script for the inner workings. Here’s the essence of it:
myOriginalGamma = fileIngamma --store the current input gamma
fileIngamma = 1.0 --set the gamma for the correct display
picButton.images = #(myImage, undefined,1,1,1,1,1) --set the image to the button
fileIngamma = myOriginalGamma --set the gamma back to whatever it was
This is the demo showing that you can change the gamma-appearance of picturebuttons.