Open micahflee opened 9 years ago
Bingo. I just used pdf-redact-tools for the first time and the quality of the output I got was unusable for my needs.
There really needs to be an option to control the quality level.
So, I added a flag to specify quality in the PR above, however, I don't know much about image quality or compression. I checked the information is sent to the convert command, but I cannot tell whether it makes the expected difference in the PNG files. Also, please, let me know if I need to set limits to the values of quality (besides them being integers).
Maybe @micahflee @masetime have some idea about this since you were commenting on the quality of the PNGs
I've currently hit the same thing where the loss of image quality is unacceptable.
Since the -quality
flag is about compression, maybe we should use the -density
flag to increase the density to -density 300
. ImageMagick's default is 72. Here, on line 55, it's being set to 128.
A similar plan to what @anaisabel7 has done in #24 could be applied for density.
I've found that that using ghostscript directly, you retain pretty good PNG resolution from a PDF.
gs -sDEVICE=png16m -dTextAlphaBits=4 -r300 -o foo.png bar.pdf
Right now when pdf-redact-tools explodes a PDF into PNGs, the PNGs are all medium quality in order to make sure the final redacted PDF doesn't end up too big. However sometimes the quality is too low. It would be good to expose a quality option to users as a command-line flag.