I had to look this week for a faster/lighter png encoder in cpp, couldn’t find any alternatives to libpng.
Edit: stb_image_write exists, I was reading it wrong
And it doesn't look like the png crate provides a C API but if your usage is not overly complex it might be easy enough to byo?