image-compression

Compressing image with python-opencv actually results more size

Compressing image with python-opencv actually results more size Question: I want to compress image in-memory using python. Using this code from answer https://stackoverflow.com/a/40768705 I expect that changing "quality param" (90) I will get less size of result image. encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), 90] result, enc_img = cv2.imencode(‘.jpg’, img_np, encode_param) My original plan was to decrease this …

Total answers: 1

Python PIL Rotate (Image Result Quality)

Python PIL Rotate (Image Result Quality) Question: I’m using Python 3.11 with Pillow 9.3.0 and OpenCV 4.6.0.66. I want to make sure if I doing 90 degree rotate with PIL, the quality of image is same. ret = False frame = None camera = cv2.VideoCapture(0, cv2.CAP_DSHOW) if camera.isOpened(): camera.set(cv2.CAP_PROP_FPS, 30.0) camera.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter.fourcc(‘m’, ‘j’, ‘p’, ‘g’)) …

Total answers: 1

Compressing a PDF's images using Python (help replacing images inside a PDF)

Compressing a PDF's images using Python (help replacing images inside a PDF) Question: My goal is to have a Python script that will take a PDF, extract its images, compress/resize them, and then push this new data to the PDF which will result in a new, smaller PDF. So far I have done everything except …

Total answers: 1