Объедините каналы изображений двух изображений с помощью oiiotool

В oiiotool есть команда для переключения каналов изображения с помощью команды --ch, например:

oiiotool rgba.tif --ch R=B,G,B=R,A -o bgra.tif

Я спрашиваю, есть ли возможность загрузить два изображения в стек и добавить, скажем, красный канал из изображения A в зеленый канал изображения B.

1 ответ

Решение

Если кому-то нужен ответ, вот он:

oiiotool A.exr --ch R  B.exr --ch B  --chappend  A.exr --ch G  --chappend  --chnames R,G,B  -o mix.exr

Чтобы понять, что это значит,

* read A, take just its R channel
* read B, take just its G channel
* Append channels of the the top two images, yielding A.r,B.g on the top of the stack
* read A again, take just its B channel
* Append the channels of the top two images, now you have A.r,B.g,A.b
* Force new channel names R,G,B just in case they carry their old names or got confused
* Output to mix.exr
Другие вопросы по тегам