Hacker News new | ask | show | jobs
by wan888888 3 hours ago
I'm having a similar use case from time to time, I just use imagemagick

magick -density 150 input.pdf \ -colorspace Gray \ -virtual-pixel White -background White \ -rotate 0.7 +repage \ -attenuate 0.45 +noise Gaussian \ -blur 0x0.4 \ -brightness-contrast -5x12 \ -compress jpeg -quality 78 scanned.pdf

2 comments

I have something similar. Someone asked for a signed PDF. I digitally signed it and sent it to them. They said it has to be scanned. So I did some image magic fu to it to rotate it and make it look crappy. Then they accepted it.
My goto technique: apply signature stamp. Flatten. Change blend mode to multiply. Convert page to image. Rotate image by 0.5 deg. Paste scanned page on tape. Flatten. Change blend mode of image to burn or multiply. Convert to image.

The only tell tale sign is that the text still has this aliasing like texture that doesn’t happen in real scanned pages.

Yeah I don't want to rain on OPs parade; but this is already a solved problem:

From my bookmarks (found on HN originally!)

https://gist.github.com/andyrbell/25c8632e15d17c83a54602f6ac...