CImage:Blendx
The Blendx method blends the pixel values with a constant value. An interpolation is performed between each pixel value and the number
bResult = CImage:Blendx( x, nBlend ) The value x may be passed as a number or a string. The interpolation value nBlend is a percentage. On success, this method returns true On failure, this method returns false. |
The result of this operation is a "dilution" of the pixel value relative to the constant. The interpolation constant nBlend measures the distance between the pixel value and the pure number x. For each image pixel, the result is as follows:
A value nBlend=0 reproduces the pixel value exactly.
A value nBlend=100 reproduces the constant value exactly.
Similarly a value nBlend=50 produces a result midway between the pixel value and the constant x. Values outside the range [0,1] extrapolate by effectively removing the pixel value from the number or by removing the number from the pixel value.
The value x can be passed as a numeric value or a string. Using a string is the only way to pass an rgb color value but it may also be used for numeric type images.
The following script loads an image from the file sPath, blends the pixel values equally (50%) with the number 1000, and saves the result back to the file:
|
-- create a new CImage |
|
-- load the image from a file named sPath |
|
-- perform the operation |
|
|
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.