2016-05-13 1 views
0

この画像の幅は500ピクセルです。左右のテキストに空白やパディングを追加したい。 私が試した:Imagemagickのテキストにパディングを追加するには?

convert source.jpg \ 
     -size 500x \ 
     -background blue \ 
     -fill white \ 
     -pointsize 32 \ 
     caption:"Sed felis eros, ornare ut cursus a, imperdiet sit amet purus." \ 
     +swap \ 
     -append \ 
     output.jpg 

結果:

enter image description here

その後、それは青色の列追加スプライスを使用してみました:

convert source.jpg \ 
     -size 500x \ 
     -background blue \ 
     -fill white \ 
     -pointsize 32 \ 
     caption:"Sed felis eros, ornare ut cursus a, imperdiet sit amet purus." \ 
     -splice 10x10 \ 
     +swap \ 
     -append \ 
     output.jpg 

結果:

enter image description here

青いテキストボックスの周りだけをパディングする方法は?

答えて

1

-extent-gravityのオプションがありますか?含めるにコメント

からの例(説明するための色で)以下

convert \(\ 
     -size 500x \ 
     -background blue \ 
     -fill white \ 
     -pointsize 32 \ 
     caption:"Sed felis eros, ornare ut cursus a, imperdiet sit amet purus." \ 
    \) \ 
    source.jpg \ 
    -append \ 
    -background green \ 
    -gravity Center \ 
    -extent 520x \ 
    output.jpg 

How to add padding to text

それとも、テキスト...

convert \(\ 
     -size 480x \ 
     -background blue \ 
     -fill white \ 
     -pointsize 32 \ 
     caption:"Sed felis eros, ornare ut cursus a, imperdiet sit amet purus." \ 
     -gravity Center \ 
     -extent 500x \ 
    \) \ 
    source.jpg \ 
    -append \ 
    output.jpg 

Just the text part

編集トップ/ボーttom &左/右詰め、その後、あなたがかもしれないとしても、私たちに-border

convert -size 480x \ 
     -background blue \ 
     -fill white \ 
     -pointsize 32 \ 
     caption:"Sed feels eros, ornate ut cursus a, imperdiet sit amet purus." \ 
     -bordercolor green \ 
     -border 10x20 \ 
     output.png 

Top & bottom padding

+0

グレート!感謝emcconville。しかし、青い枠の周りに上下の詰め物を追加したい場合は、どうすればいいですか? – g13

関連する問題