You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Due to reduced Image quality (after conversion), text is not readable . This has been tried in colab notebook To Reproduce
Steps to reproduce the behavior:
from pdf2image import convert_from_path, convert_from_bytes
from IPython.display import display, Image
The way the code is written, both parameters (dpi and size) are being sent to pdftoppm this means that the issue you are seeing is most likely not at the pdf2image level, but in the underlying library.
My best solution would be to resize the output of pdf2image manually instead of using the parameter. Something like:
fromPILimportImageimages=convert_from_bytes(open('/content/sample_data/test.pdf', 'rb').read(), size=800,dpi=400)
images[0].thumbnail((800, 800)) # This is in place I thinkdisplay(images[0])
Describe the bug
Due to reduced Image quality (after conversion), text is not readable . This has been tried in colab notebook
To Reproduce
Steps to reproduce the behavior:
from pdf2image import convert_from_path, convert_from_bytes
from IPython.display import display, Image
images = convert_from_bytes(open('/content/sample_data/test.pdf', 'rb').read(), size=800,dpi=400)
display(images[0])
Expected behavior
text in the image should be clear
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
colab notebook with Chrome browser
The text was updated successfully, but these errors were encountered: