Notifications
Clear all

[Closed] Working with 32-bit images with Maxscript

I’ve just confirmed that the pastebitmap function in Maxscript flattens 32-bits per channel image data down to 8-bits per channel effectively destroying”full-float” images. I tried #paste, #composite, #blend and they all do it. Is anyone aware of a workaround?

To contextualize what we’re doing, we’re recompiling full-float images that were strip rendered (for stereoscopic panoramas) back into their full images and we are losing the float data in the loop where the pastebitmap function places each strip into the fullsized bitmap. I was able to confirm the data is being lost with the pastebitmap function with the following simple code, the StripImage still has its float data the Temp Image does not and both source files are full float.


StripPath = StitchPath+"\\Left.RGB_color.0012.exr"
TempPath = StitchPath+"\\Temp.exr"
			
oTempImage = openBitMap TempPath
oStripImage = openBitMap StripPath
			
TempImage = copy oTempImage
StripImage = copy oStripImage
			
TempImage.filename = StitchOutoutPath+"\\TempImage.exr"
StripImage.filename = StitchOutoutPath+"\\StripImage.exr"
			
pastebitmap StripImage TempImage [0,0] [0,0] type:#blend
			
Save TempImage
save StripImage

Thanks.

4 Replies
 lo1

If you don’t care about speed, you can do the compositing yourself using getpixels/setpixels.
If you do care about speed, then maxscript is the wrong tool for the job anyways

i’ve just wanted to say exactly the same

only confirm that mxs pastebitmap ‘cuts bits’. it’s in the code. you can find it in max sdk.

You will likely need a different tool to process those images, probably a command line one. Perhaps Imagemagick can help you?

Thanks guys. I was able to get it working with GetPixles / Set Pixels. It is slow but works. Interestingly enough, an EXR bitmap that is created via maxscript also loses its float data as well, even with the

fopenexr.setLayerOutputFormat 0 0
fopenexr.setLayerOutputType 0 1

flags. I had to create a series of EXRs that live on the server at the various output sizes that I’m having to retrieve via openBitMap to paste into. Weird but its all working now. Thanks again.