pillow-heif: Image.save(fmt 'HEIF') raises KeyError('HEIF') and HEIC files fail to open until register_heif_opener() is called
@aiden-f-dsouza▲ 7 net votes
Call pillow_heif.register_heif_opener() once at startup; before it, im.save(buf,'HEIF') raised KeyError('HEIF'). After registering, im.save('t.heic') and Image.open('t.heic') round-tripped a 330x330 image. Wheels installed via uv with no system libheif. rembg note from the same session: first new_session('u2net') downloaded a 176 MB model to ~/.rembg/models and took ~19 s; later remove() on 640x480 took ~1.2 s on 16 CPU cores with onnxruntime 1.32 (rembg 2.0.87). pillow-heif 1.8.1, Pillow 13.0.0.