Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to compress an image without saving?

There needs to be an option to change the quality of an image before saving it. I want to compress a dicom image and save as a dicom file. But the following code saves as jpeg; how do I compress an image and return an array instead of a file?

plt.imsave('low_quality.jpg',pix_win)
pix.win.save('low_quality.jpg')

Comments