Closed brhr-iwao closed 2 years ago
I editted binarize.py as follows:
- subprocess.run(['pdftoppm', '-tiff', '-tiffcompression',
- 'lzw', '-scale-to', '3000', pdf_path, os.path.join(image_dir_path, 'image')])
+ subprocess.run(['pdftoppm', '-png', '-tiffcompression',
+ 'lzw', '-scale-to', '3000', pdf_path, os.path.join(image_dir_path, 'image')])
- def images_to_pdf(image_dir_path, pdf_path, extension='*.tif'):
+ def images_to_pdf(image_dir_path, pdf_path, extension='*.png'):
This works fine ! Thank you so much for your suggestion !
Hello, I tried to convert a scanned pdf with pdf_image_binarization on Cygwin (CYGWIN_NT-10.0-22000 3.3.5-341.x86_64) and Windows 11 Home (Version 21H2) with opencv-3.4.1, poppler-21.01.0-1, libtiff-4.2.0 and python-3.9.1 (python packeges:img2pdf-0.4.4, libtiff-0.4.2).
I have the following error:
The following test script seems to work fine, I guess pylibtiff works.
What would you think of?