Skip to content
Discussion options

You must be logged in to vote

You do not disturb at all, no worries.

make dirty greyish background white and make the contrast higher

In general no, this is out of PyMuPDF's scope. It actually is an image enhancement topic. You might want to consult Pillow documentation for this.
Also, OCRmyPDF has a feature in that area if I remember correctly. Including improvement of the scanned image orientation.

There are a handful of things in PyMuPDF which may also help, e.g.

  1. gamma correction of the pixmap
  2. you could write your own routine and examine the pix.samples. Like making it white based on some threshold, e.g. if for an RGB image the pixel is greater than (200, 200, 200) replace it by (255, 255, 255) or whatever. But …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@maiiabocharova
Comment options

@maiiabocharova
Comment options

@JorjMcKie
Comment options

@maiiabocharova
Comment options

Answer selected by maiiabocharova
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1516 on January 05, 2022 16:21.