Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Multiplies all values in a channel.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
GraphicsMagick | 5.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
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 | The value to add before multiply. Usually between -65535 and 65535. | 0 | Optional |
Add2 | The value to add after multiply. Usually in range from -65535 to 65535. | 65535*0.9 | Optional |
Returns OK or error.
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)
Invert image via multiply:
Set Variable [ $image ; Value: MBS( "GMImage.NewFromContainer"; Invert::Input ) ]
# each channel...
// Set Variable [ $r ; Value: MBS( "GMImage.MultiplyChannel"; $image; "red"; -1; 0; 65535) ]
// Set Variable [ $r ; Value: MBS( "GMImage.MultiplyChannel"; $image; "green"; -1; 0; 65535) ]
// Set Variable [ $r ; Value: MBS( "GMImage.MultiplyChannel"; $image; "blue"; -1; 0; 65535) ]
# all channels...
Set Variable [ $r ; Value: MBS( "GMImage.MultiplyChannel"; $image; "rgb"; -1; 0; 65535) ]
Set Field [ Invert::Output ; MBS( "GMImage.WriteToPNGContainer"; $image; "output.png") ]
Set Variable [ $r ; Value: MBS( "GMImage.Release"; $image) ]
Created 3th February 2015, last changed 11st November 2019
GMImage.MotionBlur - GMImage.Negate
Feedback: Report problem or ask question.