Adjust contrast and brightness of a PDF

1/05/2012

In case you want to adjust brightness and contrast of a PDF file on the Mac (or Linux) you can use ImageMagick. Here is what I used:

convert -brightness-contrast 10,50  -compress lzw  \
        -density 500 -colorspace Gray input.pdf output.pdf

the -brightness-contrast 10,50 controls the brightness and contrast (they can both take values from -100 to +100), Density controls the resolution and -colorspace controls the color output. In this case, its Gray. lzw is a lossless compression method.

There are 8 comments in this article:

  1. 30/08/2013Lekshe say:

    Hello. I just installed ImagaMagick but I can´t make the commands you describe to work.

    I made an input.pdf in the C:\Program Files\ImageMagick-6.8.6-Q16 folder.

    First I tried writing it exactly as in the website, I got the following:
    ******
    C:\Program Files\ImageMagick-6.8.6-Q16>convert -brightness-contrast 10,50 -comp
    ress lzw \ -density 500 -colorspace Gray input.pdf output.pdf
    convert.exe: unable to open image `\’: No such file or directory @ error/blob.c/
    OpenBlob/2643.
    convert.exe: no decode delegate for this image format `\’ @ error/constitute.c/R
    eadImage/552.
    convert.exe: `%s’ (%d) “gswin32c.exe” -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOP
    ROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 “-sDEVICE=pngalpha”
    -dTextAlphaBits=4 -dGraphicsAlphaBits=4 “-r500x500” “-sOutputFile=C:/DOCUME~1/L
    ekshe/LOCALS~1/Temp/magick-2812QXqzW8X5FCHy-1” “-fC:/DOCUME~1/Lekshe/LOCALS~1/Te
    mp/magick-2812nyzn1oNKanoU” “-fC:/DOCUME~1/Lekshe/LOCALS~1/Temp/magick-2812eOyKM
    hWhiHs2″ @ error/utility.c/SystemCommand/2033.
    convert.exe: Postscript delegate failed `input.pdf’: No such file or directory @
    error/pdf.c/ReadPDFImage/682.
    convert.exe: no images defined `output.pdf’ @ error/convert.c/ConvertImageComman
    d/3108.
    ******
    The I tried it without the ” \” behind -density and I got the following:

    ******************
    C:\Program Files\ImageMagick-6.8.6-Q16>convert -brightness-contrast 10,50 -comp
    ress lzw \ -density 500 -colorspace Gray input.pdf output.pdf
    convert.exe: unable to open image `\’: No such file or directory @ error/blob.c/
    OpenBlob/2643.
    convert.exe: no decode delegate for this image format `\’ @ error/constitute.c/R
    eadImage/552.
    convert.exe: `%s’ (%d) “gswin32c.exe” -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOP
    ROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 “-sDEVICE=pngalpha”
    -dTextAlphaBits=4 -dGraphicsAlphaBits=4 “-r500x500” “-sOutputFile=C:/DOCUME~1/L
    ekshe/LOCALS~1/Temp/magick-1928LB6NdozAvAN4-1” “-fC:/DOCUME~1/Lekshe/LOCALS~1/Te
    mp/magick-1928Y-tpUWYs0lnt” “-fC:/DOCUME~1/Lekshe/LOCALS~1/Temp/magick-19287-fz9
    nc16Lra” @ error/utility.c/SystemCommand/2033.
    convert.exe: Postscript delegate failed `input.pdf’: No such file or directory @
    error/pdf.c/ReadPDFImage/682.
    convert.exe: no images defined `output.pdf’ @ error/convert.c/ConvertImageComman
    d/3108.
    *********

    Any ideas? I´m doing something very wrong because I cannot get even the convert.exe to work.
    Thanks for your time.

    W.

  2. 31/08/2013Lekshe say:

    I figure it out. Thxs L.

  3. 18/12/2013528221 say:

    Hey I am so delighted I found your blog, I really found you by accident,
    while I was searching on Bing for something else, Anyways I am here now and would just like to say thank
    you for a fantastic post and a all round entertaining blog (I also love the theme/design), I don’t have time to
    browse it all at the moment but I have bookmarked it and also included your RSS feeds, so when I have time I
    will be back to read a lot more, Please do keep up the awesome b.

  4. 10/07/2014Read more about personal loans toronto say:

    All of us have these occasions in life that
    truly merely embarrassed us and we start
    wishing that we’re able to return in time and do things completely distinct so that
    we could have got results that are better. It possibly that time when you accepted a
    dare from your friend, or possibly the moment you forgot
    your greatest friend’s birthday. How about the moment when the statement came you were found out
    by you and when you had been on a day with the individual of
    your fantasies didn’t have the money to spend?
    Look when you actually want it is not only embarrassing it’s
    dismal we all have been there and lacking cash and it’s extremely annoying.
    Properly at eastern loans we provide cash advances which are dangerous
    to use. Whether you maybe get that one-of-a-kind tattoo you always had dreamed of our paydayloans, do a bit of grocery shopping or simply
    need to spend some bills Toronto support is constantly there to help you.
    Let us explain how it works. You start by completing our convenient and
    secure on-line application. Today in this program you
    allow us understand how much you want ranging anywhere from 500 dollars and more.
    Then you’re going to provide some basic details about yourself.
    Next you inform us which bank do you want us
    to deposit our cash in, a bank is needed by us or we will not be of any aid.
    Eventually you may give some employment information that is basic to
    us. Now once you have completed the program we direct you straight with their site and will match you to a lender according to their demands.
    The lender will subsequently exhibit charges, your loan,
    terms and conditions for your acceptance. Today once you are authorized you will possess the cash
    immediately deposited into your bank balances
    in as fast as 24 hours. Today we know also
    that everybody does not have a spotless credit rating and that’s also fine.
    Asian Loans payday loans expected future revenue simply to make certain you have the
    capacity to pay back your mortgag

  5. 6/09/2014free pdf download of divergent say:

    Heya excellent blog! Does running a blog similar to this take
    a great deal of work? I have no expertise in programming but I
    was hoping to start my own blog in the near future. Anyhow, should you have any suggestions or tips for new blog owners please share.

    I know this is off subject but I just wanted to ask. Thanks a lot!

  6. 11/10/2014nu Doctor say:

    Περιπλανιέμαι στο ιντερνέτ σήμερα για περισσότερες από τέσσερις ώρες και δεν
    βρήκα πολλά άρθρα που να είναι εξίσου ενδιαφέροντα με το δικό
    σας. Πιστεύω ότι αν όλοι
    οι ιδιοκτήτες των blogs έφτιαχναν
    τέτοιο ποιοτικό περιεχόμενο το ιντερνετ, θα ήταν πολύ καλύτερο για όλους.

  7. 12/10/2014Athinanews say:

    Περιπλανιέμαι στο ιντερνέτ σήμερα για περισσότερες από 2 ώρες και δεν βρήκα πολλά άρθρα που να είναι εξίσου
    ενδιαφέροντα με το δικό σας.

    Πιστεύω ότι αν όλοι οι webmasters των sifes έφτιαχναν τέτοιο ποιοτικό περιεχόμενο το ιντερνετ, θα ήταν πολύ καλύτερο για όλους.

  8. 23/07/2015υγιεινός τρόπος ζωής say:

    Ο παγκόσμιος οργανισμός υγείας στην 34η Γενική
    Συνέλευση το 1981 έθεσε τις βάσεις και προγραμμάτισε δραστηριότητες με σύνθημα Υγεία για όλους το 2000.

Write a comment: