I try to convert the first page of a book to a png, scale the png to a certain size and add a black border. This is what I tried:

convert tmp.pdf\[0\] -background white -alpha remove -border 8 -bordercolor black cover.png

This is the document, I want to convert.

For some reason I have to specify -background white -alpha remove since otherwise my white border does not appear or is grey. My problem is that the border that is added is grey not black. Is there anything I can do?

  • what does \[0\] do?
    – ddzzbbwwmm
    Oct 31 '16 at 14:55

What worked for me is moving the -bordercolor option before the actual -border statement:

convert tmp.pdf\[0\] -background white -alpha remove -bordercolor black -border 8 cover.png

should do the trick. I can't find anything in the man page that points to why this should be so, though.

  • Thanks a lot! I tried moving the two related options together, but did not try this one. Thanks! Dec 4 '13 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.