Notifications
Clear all

[Closed] IMGTag Gamma in DialogBox

Sooooo I have all my max settings to Gamma 2.2 but it would seem that IMGTags don’t get color corrected so they all look super dark.

Suggestions?

4 Replies

Yes, we’re having the same issues here. It’s hard to see the previews from our libraries because they’re so dark. I’d be very happy to script my way around it instead of having to edit those images!

Klaas.

 PEN

You could try dotNet pictureBox instead.

Well,

I’ve found a solution to fix images in buttons related to gamma settings. When max is set to gamma 2.2 it seems that images in script-buttons are too dark. You can avoid this by setting the gamma to 1.0 right before you add the image to the button. Don’t forget to set the gamma to it’s original value afterward. I’ve added an example, have Fun!

Klaas

/*
 this script demonstrates bitmaploading and gamma.
 
 bitmaps loaded into buttons tend to be darker than they should be when a gamma different than 1.0 is used
 the gamma of a bitmap is a read-only property but you can change the system gamma before loading an image into 
 a button. this effectively changes the display gamma of the image. don't forget to set the gamma back to
 what it was!
 
 if you pick "specifiy gamma" when picking an image from disk and set it to 1.0, the script cannot alter it anymore...
 */
 try(destroyDialog klaasNienhuisGammaTest)catch()
 
 rollout klaasNienhuisGammaTest "Test gamma value"
 (
 	button picButton "Click to load picture..." width:180 height:180
 	radiobuttons radGamma "Change gamma of picture" labels:#("1.0","2.2","5.0") default:2
 	button btnShow "Show picture in VFB"
 	
 	local myImage = undefined
 	
 	on picButton pressed do
 	(
 		myImage = selectBitMap() --acquire an image from disk
 		if myImage != undefined do picButton.images = #(myImage, undefined,1,1,1,1,1) --put the image into the button. 
 	)
 	
 	on btnShow pressed do
 	(
 		if myImage != undefined do display myImage
 	)
 	
 	on radGamma changed arg do
 	(
 		case arg of
 		(
 			1: 
 			(
 				fileIngamma = 1.0 --set the gamma
 				if myImage != undefined do picButton.images = #(myImage, undefined,1,1,1,1,1) --set the image to the button
 				fileIngamma = 2.2 --set the gamma back	
 			)
 			2:
 			(
 				fileIngamma = 2.2				
 				if myImage != undefined do picButton.images = #(myImage, undefined,1,1,1,1,1)
 				fileIngamma = 2.2				
 			)
 			3:
 			(
 				fileIngamma = 5.0				
 				if myImage != undefined do picButton.images = #(myImage, undefined,1,1,1,1,1)
 				fileIngamma = 2.2				
 			)
 		)
 	)
 )
 createDialog klaasNienhuisGammaTest 200 260

Hahaha. Brilliant!