Eyeon:Script/Reference/Applications/Fuse/Classes/Image/BlendOf
From VFXPedia
< Eyeon:Script | Reference | Applications | Fuse | Classes | Image
Contents |
Summary
The BlendOf function will blend one image with another image. A numerical value can be used to specify how much of the foreground is blended with the background, or an image can be used to provide a map providing different blend values for each pixel. This is the function used internally by Fusion when a tools blend slider is adjusted.
The function returns a new image containing the results of the blend operation.
This function requires Fusion 5.3 or later.
Usage
Image:BlendOf(image fg, numeric val)
OR
Image:BlendOf(image fg, image map)
- fg (image, required)
- The image to use as the foreground for the blend operation.
- val (numeric, required)
- A numeric value that describes how much of the foreground is combined with the background. Alternately, this argument can be an image map, as described below.
- map (image, required)
- A map image that describes how the pixels from the foreground should be combined with the background. The value of the pixels in the map image provide the amount of Blend.
Example
This example blends one image with another using a third image as a map.
FuRegisterClass("BlendOf", CT_Tool, { REGS_Category = "Fuses\\eyeon\\Examples", REGS_OpIconString = "Bln", REGS_OpDescription = "Blend Fuse", REG_OpNoMask = true, REG_NoBlendCtrls = true, REG_NoObjMatCtrls = true, REG_NoMotionBlurCtrls = true, }) function Create() InBlank = self:AddInput(" ", "Blank", { LINKID_DataType = "Number", INPID_InputControl = "LabelControl", INP_External = false, }) InBG = self:AddInput("Background", "Background", { LINKID_DataType = "Image", LINK_Main = 1, }) InFG = self:AddInput("Foreground", "Foreground", { LINKID_DataType = "Image", LINK_Main = 2, }) InMap = self:AddInput("Map", "Map", { LINKID_DataType = "Image", LINK_Main = 3, }) OutImage = self:AddOutput("Output", "Output", { LINKID_DataType = "Image", LINK_Main = 1, }) end function Process(req) local img_bg = InBG:GetValue(req) local img_fg = InFG:GetValue(req) local map = InMap:GetValue(req) img = img_bg:BlendOf(img_fg, map) OutImage:Set(req, img) end
Tips for BlendOf (edit)
EyeonTips:Script/Reference/Applications/Fuse/Classes/Image/BlendOf