I wonder how to compress (if that's what it's called) the image without loosing the quality (or loosing a little)? I want it to be compressed in order to it being loaded very quickly on my website. For example: the original image is 10 MB, I want to resize it and compress so it be like 2-3 MBs, or even better about 900KBs. How to do that besides resizing. What is the difference between resizing and compression? Which of them makes the image size (in MB) smaller?
I saw somewhere that this compresses the image, but does this actually what I want?
cv2.imwrite(self.image.path, image, [int(cv2.IMWRITE_PNG_COMPRESSION), 9])
Thanks in advance!