I need help to remove gray background from a pdf file and save it as pdf if possible.
The document has two gray backgrounds.
removing gray background from pdf
Re: removing gray background from pdf
You should make an image available for testing as you will not get a very useful answer without.
Re: removing gray background from pdf
I was trying to upload portion of the image but I couldn't find any option to make an attachement.
How add the attachment?
The two gray colors I want to remove from pdf are HEX: d2d2d2 and HEX: b8b8b8
I used gimp to get the HEX colors.
Here is the link to the image: http://i850.photobucket.com/albums/ab70 ... cument.jpg
How add the attachment?
The two gray colors I want to remove from pdf are HEX: d2d2d2 and HEX: b8b8b8
I used gimp to get the HEX colors.
Here is the link to the image: http://i850.photobucket.com/albums/ab70 ... cument.jpg
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: removing gray background from pdf
First, do not use jpg from pdf. The jpg compression with make the gray colors vary. You would be best to upload the PDF or at least convert to PNG. You can post to any free hosting service and put the URLs here.
What do you mean by remove? Make transparent?
With jpeg you will need to add some small fuzz value. Try varying the fuzz value to get what you need.
If on windows you may need to double the %
When posting questions to this forum, please always provide your version of IM and platform.
What do you mean by remove? Make transparent?
With jpeg you will need to add some small fuzz value. Try varying the fuzz value to get what you need.
Code: Select all
convert document.jpg -fuzz 1% -channel rgba -fill none -opaque "#d2d2d2" -opaque "#b8b8b8" result.png
When posting questions to this forum, please always provide your version of IM and platform.
Re: removing gray background from pdf
Thank you for offering solution.fmw42 wrote:[snip]
When posting questions to this forum, please always provide your version of IM and platform.
The IM ver. is: imagemagick-6.8.9.9 on Linux (Gentoo)
I don't care if it is transparent or white, I just want to get rid of the gray backgound when printing to save on toner as the gray scale is entire page. I just need to print the pdf file, I don't need to save it.
Note my input is pdf file: document.pdf
when I tried:
Code: Select all
convert document.pdf -fuzz 1% -channel rgba -fill none -opaque "#d2d2d2" -opaque "#b8b8b8" result2.pdf
When I increased the "-fuzz 15%" the background is gone but the font is choppy and hard to read.
When I converted the PDF to PNG:
http://i850.photobucket.com/albums/ab70 ... cument.png
and use:
Code: Select all
convert document.png -fuzz 1% -channel rgba -fill none -opaque "#d2d2d2" -opaque "#b8b8b8" result2.pdf
convert document.pdf to document.png is making font very choppy.
Maybe there is a way to get rid of all colors except "black", is there? It might be simpler.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: removing gray background from pdf
We would need to see your PDF document to see what the issue might be. But for PDF (if vector), you can use the -density argument before reading the PDF to make it much higher resolution, then change the colors, then scale it down to a smaller size if you want.
Re: removing gray background from pdf
Thank you again.fmw42 wrote:We would need to see your PDF document to see what the issue might be. But for PDF (if vector), you can use the -density argument before reading the PDF to make it much higher resolution, then change the colors, then scale it down to a smaller size if you want.
Yes, implementing -desity helped. It is a bit slower to convert but the font quality is much better.
Code: Select all
convert -density 300 document.pdf -fuzz 10% -channel rgba -fill none -opaque "#d2d2d2" -opaque "#b8b8b8" result1.pdf