2016-09-27 2 views
0

이미지의 테두리를 희석하려고합니다. 즉, 왼쪽에서 100px 수직 스트라이프를 흰색으로 그리고 오른쪽, 위, 아래에서 흰색으로 똑같이.니다. 다음은 왼쪽에서 작동합니다.ImageMagick 흰색 경계선 줄무늬

mogrify -crop +100+0 -background white -gravity west -splice 100x aaa.tif 

그러나 다른면과 동일한 방법을 알아낼 수는 없습니다. 나는 동쪽, 서쪽, 많은 기하학을 시도했다. 또한 위의 명령보다 나은 대안이 있는지 알려 주시기 바랍니다.

답변

0

-extent 옵션을 탐험해볼 가치가 있을지 모르지만, 패딩을 추가하는 것이 더 빠를 것이라고 생각합니다. 예를 들어

... 로즈 (시각적 예를 들어, 사용 블루)

convert -background blue \ 
     -size 100x xc:blue \ 
     \(rose: -crop +50+0 \) \ 
     -size 100x xc:blue \ 
     +append \ 
     output.png 

padding on both ends

+0

아! 나는 그 질문을 잘못 읽었다. @ MarkSetchell의 대답은 이상적인 해결책이 될 것입니다. – emcconville

2

시작 :

enter image description here

내가 할거야 당신이 내가 뭘 StackOverflo에서 볼 수 있도록 노란색과 마젠타 테두리 w의 흰색 배경.

convert rose: -shave 10x10 -bordercolor magenta -border 10 result.png 

enter image description here

우측

convert rose: -gravity east -chop 10x -background yellow -splice 10x result.png 
,691,363 :

모든면

셰 이브 10px 떨어져 모든 측면과는 모든면에서 다시 10px를 넣어 (210)

enter image description here

좌측

convert rose: -gravity west -chop 10x -background yellow -splice 10x result.png 

enter image description here

최고

convert rose: -gravity north -chop x10 -background yellow -splice x10 result.png 

enter image description here

바닥

convert rose: -gravity south -chop x10 -background yellow -splice x10 result.png 

enter image description here

왼쪽과 오른쪽

convert rose: -shave 10x -bordercolor magenta -border 10x result.png 

enter image description here

으로 P 및 아래쪽

convert rose: -shave x10 -bordercolor magenta -border x10 result.png 

enter image description here

태그 : ImageMagick이, 경계, 경계, 내부 중력 한쪽 여러 측면 가장자리, 프레임, 프레임, overpaint 화이트 아웃

경우 당신은 Photoshop의 "Border Outside"와 같은 기능을 원한다면 -shave 또는 -chop을 생략하면됩니다.