ScriptSpot

Forum topic · Scripts Wanted

Image loader

By titane357 · 2010-10-04

Description

Hello,
I looking for a script which lists all maps used in the scene in a table in the left column, and in the right column its corresponding gamma.
Then you can select (and multi select) maps and choose another gamma.
These images are reloaded with new gamma.
Thanks

Comments (9)

Anubis · 2010-10-05

Oh, here also a bad luck... we cant find which image in which gamma is loaded.

<bitmap>.gamma

always return the global input gamma insted of the current :/

Attachments

titane357 · 2010-10-05

dooh !
I tested the maxscript example :
print (getBitmapInfo (getDir #maxroot + "\\maps\\OAKLEAF.TGA"))
and yes it take Imput gamma....
How do you list all images used in the scene ? (already loaded ?)

one bad and one good news

Anubis · 2010-10-05

You can get easy all bitmap textures used in the scene (an array containing their filename strings) with

usedMaps()

. Bwn one bad and one good news...

b1 = bitmap 320 240 filename:"C:/test.jpg" gamma:2.2 -- save as JPG
b1.gamma -->> 0.454545
render to:b1; save b1; close b1
(getBitmapInfo "C:/test.jpg")[8] -->> 1.0 (this is the BAD news)

b2 = bitmap 320 240 filename:"C:/test.tga" gamma:2.2 -- save as TGA
b2.gamma -->> 0.454545
render to:b2; save b2; close b2
(getBitmapInfo "C:/test.tga")[8] -->> 0.454 (this is the GOOD news)

titane357 · 2010-10-05

urgh ! If I well understand, as it is said in maxscript help, we can change gamma just on copy of image, but in fact just with .tga ?

Anubis · 2010-10-06

yep, that's right, and with all images, not only with TGA.
The test above just show that TGA save actual value within the phisical image file, while the JPEG not.

titane357 · 2010-10-06

Thanks for your explanations :-)

titane357 · 2010-10-05

hello Anubis, can't scripter access to the load image command, to reload the already loaded image but with another gamma ? toooo bad.
Yes, color correction is cool when you know which image is in which gamma...
In imported and merge scenes it is sometimes the mess, so a read only list should be something good.... :-)

Hi Titane,Sounds good, but

Anubis · 2010-10-04

Hi Titane,
Sounds good, but unfortunately, currently not possible to change the gamma of a bitmap without creating new one. Of course Max allows to set input/output gamma, but globals for all scene bitmaps.

P.S. - You can test Color Correction texture map (introduced in Max 2009), but its very bugged though.