Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

GMImage.MultiplyChannel

Multiplies all values in a channel.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
GraphicsMagick 5.0 Yes Yes Yes Yes Yes

MBS( "GMImage.MultiplyChannel"; ImageRef; Channel; Factor { ; Add1; Add2 } )

Parameters

Parameter Description Example value
ImageRef The image reference number. 1
Channel Which channel to work with. Can be opacity, red, green or blue. The value rgb will apply effect to all three color channels. "rgb"
Factor The multiplication factor. Range from -1.0 to 1.0. 0.1
Add1 Optional
The value to add before multiply. Usually between -255 and 255.
0
Add2 Optional
The value to add after multiply. Usually in range from -255 to 255.
255*0.9

Result

Returns OK or error.

Description

Multiplies all values in a channel.
For every pixel component, we apply the formula:
newValue = ((Add1 + oldValue) * Factor) + Add2
This can be used to change brightness or make opacity less/more transparent.

Examples

Multiplies existing opacity channel to make image 90% transparent:

// existing values * 0.1 and add 90% to the value to move to higher range.
MBS("GMImage.MultiplyChannel"; $ImageRef; "opacity"; 0.1; 0; 255*0.9)


GMImage.MotionBlur   -   GMImage.Negate

Feedback: Report problem or ask question.




Links
MBS Xojo PDF Plugins