풍경 사진이 여러 장 있습니다. OSX에서 ImageMagick CLI를 사용하여 올바르게 왜곡하고 오버레이하고 싶습니다. 여러 사진과 참조 사진 사이의 왜곡 좌표를 찾았습니다. 나는의 차이 -distort
와 +distort
그것이 어떻게 작용하는지 이해하지 못합니다 +repage
. 을 사용 -distort
하면 출력에 원하는 오프셋이 있지만 불완전합니다 (더 커야 함). 를 사용할 때 +distort
전체 이미지를 얻지 만 오프셋이 없습니다. 설명서를 읽으면 오프셋 정보가 손실되기 전에 동일한 명령으로 오버레이 구성을 수행하면 오프셋 없이도 할 수 있다는 것을 이해하지만, 왜곡이 참조 및 왜곡 된 이미지 모두에 적용된다는 것입니다.
The offset of the -distort
result would work once I apply it as an overlay (here using the composite
in a separate command, but it's missing a big chunk of the picture.
When I tried to consolidate it in a single command this is the result I get:
This is the command I'm currently using:
convert base.jpg overlay.jpg
-matte -virtual-pixel transparent -distort Perspective '961,1695 1856,2461 2279,1520 3185,2303 3564,2173 4441,2970 1547,2817 2441,3594'
-compose blend -define compose:args=50,100 -composite result.jpg
I understand I could use parenthesis there but I fail to see where should I put them.
Thanks!
Update: this is the result of the overlay when using +distort
either in two steps or in a single step as recommended by Mark.
The solution was to use -flatten
instead of -composite
.
convert base.jpg \( b.jpg -matte -virtual-pixel transparent +distort Perspective '961,1695 1856,2461 2279,1520 3185,2303 3564,2173 4441,2970 1547,2817 2441,3594' \) -compose blend -define compose:args=100,50 -flatten result.jpg
Turns out that -composite
ignores the image offsets whereas -flatten
works with layers and uses the offset information.
제안은 다음 스레드에서 나왔습니다. http://www.imagemagick.org/discourse-server/viewtopic.php?t=20157
이것은 flatten
(위의 논의에서 깨진 링크 )에 대한 문서입니다 . http://www.imagemagick.org/Usage/layers/#flatten
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다