Support saving of RGBA images with mi.util.write_bitmap
#767
-
If I didn't make a mistake, then apparently |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @maxfrei750 The mi.Bitmap(data).convert(
pixel_format=mi.Bitmap.PixelFormat.RGB,
component_format=mi.Struct.Type.UInt8,
srgb_gamma=True
).write('filename.jpg', quality=-1) The full interface is obviously more verbose and flexible. I still think this is a reasonable interface for end-users when |
Beta Was this translation helpful? Give feedback.
Hi @maxfrei750
The
mi.util.write_bitmap
function only expects RGB input. It's meant as a convenient and succinct one-liner for the most common case.In fact, it usually only amounts to:
The full interface is obviously more verbose and flexible. I still think this is a reasonable interface for end-users when
mi.util.write_bitmap
doesn't cover their needs. I don't see the need to further extend this helper function. For an additional alpha channel, only thePixelFormat
needs to be changed.