Welcome to WSL!

New to the forum? Please read this and this.

[ADoD] Auto Domain - Update to match features of related Auto Crop function

Moderator: Chad

User avatar
Kristof
Fusionista
Posts: 959
Joined: Thu Aug 07, 2014 1:30 pm
Answers: 6
Been thanked: 13 times

[ADoD] Auto Domain - Update to match features of related Auto Crop function

#1

Post by Kristof »

Auto Domain doesn't allow a user to specify which channel to sample to calculate the new DoD. Would be nice to have it behave in a similar fashion as the "Auto Crop" button in the Crop node.

From the manual:
Auto Crop Tab

RGBA Color Channels

Select which channels are examined for an Auto Crop. This is useful for auto cropping
images with non-solid backgrounds in a specific color channel, like a blue color
gradient. Toggling the channel off causes Auto Crop to ignore it when evaluating
the image.

Auto Crop
This evaluates the image and attempts to determine the background color. It then crops
each side of the image to the first pixel that is not this color
  1. {
  2.     Tools = ordered() {
  3.         Ellipse1 = EllipseMask {
  4.             Inputs = {
  5.                 MaskWidth = Input { Value = 1920, },
  6.                 MaskHeight = Input { Value = 1080, },
  7.                 PixelAspect = Input { Value = { 1, 1 }, },
  8.                 ClippingMode = Input { Value = FuID { "None" }, },
  9.             },
  10.             ViewInfo = OperatorInfo { Pos = { 385, 115.5 } },
  11.         },
  12.         ChannelBooleans1 = ChannelBoolean {
  13.             Inputs = {
  14.                 ToRed = Input { Value = 4, },
  15.                 ToGreen = Input { Value = 4, },
  16.                 ToBlue = Input { Value = 4, },
  17.                 Background = Input {
  18.                     SourceOp = "Background1",
  19.                     Source = "Output",
  20.                 },
  21.                 Foreground = Input {
  22.                     SourceOp = "Ellipse1",
  23.                     Source = "Mask",
  24.                 },
  25.             },
  26.             ViewInfo = OperatorInfo { Pos = { 385, 148.5 } },
  27.         },
  28.         Background1 = Background {
  29.             Inputs = {
  30.                 GlobalIn = Input { Value = 1001, },
  31.                 GlobalOut = Input { Value = 2000, },
  32.                 Width = Input { Value = 1920, },
  33.                 Height = Input { Value = 1080, },
  34.                 ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
  35.                 TopLeftRed = Input { Value = 1, },
  36.             },
  37.             ViewInfo = OperatorInfo { Pos = { 275, 148.5 } },
  38.         },
  39.         PipeRouter1 = PipeRouter {
  40.             Inputs = {
  41.                 Input = Input {
  42.                     SourceOp = "ChannelBooleans1",
  43.                     Source = "Output",
  44.                 },
  45.             },
  46.             ViewInfo = PipeRouterInfo { Pos = { 495, 148.5 } },
  47.         },
  48.         Crop1 = Crop {
  49.             Inputs = {
  50.                 XOffset = Input { Value = 480, },
  51.                 YOffset = Input { Value = 60, },
  52.                 XSize = Input { Value = 960, },
  53.                 YSize = Input { Value = 960, },
  54.                 Input = Input {
  55.                     SourceOp = "PipeRouter1",
  56.                     Source = "Output",
  57.                 },
  58.                 Red = Input { Value = 0, },
  59.                 Green = Input { Value = 0, },
  60.                 Blue = Input { Value = 0, },
  61.             },
  62.             ViewInfo = OperatorInfo { Pos = { 605, 82.5 } },
  63.         },
  64.         AlphaMultiply1 = AlphaMultiply {
  65.             Inputs = {
  66.                 Input = Input {
  67.                     SourceOp = "PipeRouter1",
  68.                     Source = "Output",
  69.                 },
  70.             },
  71.             ViewInfo = OperatorInfo { Pos = { 605, 214.5 } },
  72.         },
  73.         AutoDomain1 = AutoDomain {
  74.             CtrlWZoom = false,
  75.             Inputs = {
  76.                 Input = Input {
  77.                     SourceOp = "PipeRouter1",
  78.                     Source = "Output",
  79.                 },
  80.             },
  81.             ViewInfo = OperatorInfo { Pos = { 715, 148.5 } },
  82.         },
  83.         AutoDomain1_1 = AutoDomain {
  84.             Inputs = {
  85.                 Input = Input {
  86.                     SourceOp = "AlphaMultiply1",
  87.                     Source = "Output",
  88.                 },
  89.             },
  90.             ViewInfo = OperatorInfo { Pos = { 715, 214.5 } },
  91.         },
  92.         Note1 = Note {
  93.             Inputs = {
  94.                 Comments = Input { Value = "The AutoDomain node won't give the wanted result because it also evaluates the RGB channels which have pixels all over the canvas. I would like it to sample Alpha only, as it has been set up in the Crop node.\n\n\nPost multiplying prior to feeding it to an AutoDomain node fixes that problem but seems unnecessary.", }
  95.             },
  96.             ViewInfo = StickyNoteInfo {
  97.                 Pos = { 880, 82.5 },
  98.                 Flags = {
  99.                     Expanded = true
  100.                 },
  101.                 Size = { 196, 179.3 }
  102.             },
  103.         }
  104.     }
  105. }