The title says it all.
I have many large matrices which I want to save as JPG images under the condition, that the size of the image is small enough. Therefore I want to determine or estimate the size of the final JPG image before converting the matrix to an JPG image.
I really would like to prevent converting every matrix to an JPG image and than check the size.
How can I do that in Python?