From fb55e52843e5ffe7921f86d5d6de1f8782a1ce37 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Thu, 21 Oct 2021 23:46:13 -0700 Subject: [PATCH] [docs] Add an oiiotool example of putting a border around an image (#3138) --- src/doc/oiiotool.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/doc/oiiotool.rst b/src/doc/oiiotool.rst index 981164f70a..605f1bc8b9 100644 --- a/src/doc/oiiotool.rst +++ b/src/doc/oiiotool.rst @@ -512,8 +512,8 @@ Add other arbitrary metadata:: -Changing image boundaries -------------------------- +Changing image boundaries and borders +------------------------------------- Change the origin of the pixel data window:: @@ -540,6 +540,15 @@ and setting the display window to the new pixel data window:: oiiotool in.exr --cut 128x128+900+300 -o out.exr +Put a constant-color border around all sides of an image, without needing to +know the resolution of the input image:: + + # BW: Border width + BW=40 + COLOR=.2,.2,.2,1.0 + oiiotool in.tif \ + --pattern constant:color=$COLOR "{TOP.width+2*$BW}x{TOP.height+2*$BW}" "{TOP.nchannels}" --paste "+$BW+$BW" \ + -o out.tif Scale the values in an image