I have many .img(disk image) files. they are images and need to be
converted to .jpg format.
I tried to implement it in Python. it outputs ValueError: embedded null byte
What do I missing?
from PIL import Image
rawData = open('./1990016479_0001.img', 'rb').read()
pil_img = Image.open(rawData)
pil_img.save('./1990016479_0001.jpg', 'JPEG')
Example Image (.img disk image)
https://drive.google.com/file/d/1XYqQJTrbT2Y-4hhrLYKR3kuRIoxufy0o/view?usp=sharing
Image files are not pictures and as such they cannot be converted to pictures such as .jpg files.
To be a little more specific, I believe you are referring to binary disk images, because you specified (.img disk image).
Also, the binary file you linked doesn't look like a bitmap. The linux
fileutility didn't recognize it and neither did imagemagick.