Convert .h5 file to .jpg with Python
问题 I currently have a .h5 file containing grayscale imagery. I need to convert it to a .jpg. Does anybody have any experience with this? Note: I could possible convert the h5 file to a numpy array and then use an external library like pypng to convert that to a png. But I am wondering if there is a more efficient way to convert to an image, and preferrably a .jpg. 回答1: Key ingredients: h5py to read the h5 file. Determine the format of your image and use PIL. Let us suppose it's RGB format (https