Saving render output in a second format

Hi,

I built myself an improved texture baking UI. It works well, I’m really happy with it. (Full disclosure: I do have to admit I vibe coded it)

One feature I just cannot figure out is how to to automatically save the render in two formats after each render. For example, save as JPG and also save a PNG copy, or save as EXR and also save a JPG. I don’t want to do this through render elements… I prefer it to just be a straightforward “render once, save twice.”

What I’ve tried:

getLastRenderedImage() then setting .filename to a new path and calling save — this works for JPG, PNG, TIF copies, but the PNG comes out with the background baked in (no alpha/transparency). Seems like Corona doesn’t pass alpha through Max’s standard bitmap pipeline?

The bitmap returned by render(vfb:false) directly…completely black, unusable.

openBitmap on the saved file + copy…works but again no alpha, just copies the RGB with a solid background.

For CXR specifically, tried calling CoronaRenderer.CoronaFp.saveAllElements and saveEntireScene after the render… get “Image I/O Error: Error Creating Image Storage” dialog. Pulze Scene Manager has the exact same problem with CXR saving btw, so this isn’t just me.

Tried configuring renderer dump properties before rendering to let Corona handle it during its own pipeline.. couldn’t find the correct property names.

Has anyone got this working? What’s the right way to save a second format from code without going through render elements?

Cheers!

(Oh, and a bonus query: can I save a baked image as JPG with any background color OTHER than black?)

Hi,

I guess it is only about png saving options that need to be set. Try

pngio.setAlpha true;
pngio.setType #true48;

and then save as png.

Good Luck