I'm saving numpy arrays as jpeg compressed tiff files in the following way
import tifffile
import numpy as np
im = np.zeros((4,256,256))
tifffile.imsave('myFile.tif' , im, compression = 'jpeg' )
What I'm wondering is whether there is a parameter with which I can controll the compression strength in the same way as I can with imageio.
import imageio
imageio.imsave('myFile.jpg' , im, quality=20)
In the documentation I cannot find such a parameter, but maybe it is hidden somewhere. It feels like such a parameter should probably be out there.
I'm not 100 percent sure, but I think this is the way to do it. At least the behavior looks correct, that is the image gets smaller and indeed looks like an imageio saved image with the quality parameter.
In other words you pass the compression as a tuple, with the name of the compression and an integer.