mm_bytes = pack_micromaps(micromaps)
ext = {
"level": level,
"mode": mode,
"format": "buffer",
"micromaps": !\textbf{BinaryData}!(mm_bytes),
}
return Extension(extension=ext, ...)