How to change one color to another?
Replace Color
This operation is used if it is necessary to replace a color of the source image with another color, including transparency (alpha component). The following parameters are used to adjust settings of this operation:
- src_color - source color (default - transparent)
- dest_color - destination color (default - transparent)
- tolerance - color tolerance (default - 0)
- smooth - use smoothing (default - yes)
src_color
Src_color parameter specifies the color to be replaced with another color. The color is specified in RGBA mode.
color:"r:X1,g:X2,b:X3,a:X4"
where X1, X2, X3, X4 are whole positive numbers from 0 to 255.
The default value is: "r:255,g:255,b:255,a:255" (transparent).
Example:
dest_color
Dest_color parameter specifies the color which will replace the source color. The color is specified in RGBA mode.
color:"r:X1,g:X2,b:X3,a:X4"
where X1, X2, X3, X4 are whole positive numbers from 0 to 255.
The default value is: "r:255,g:255,b:255,a:255" (transparent).
Example:
tolerance
Tolerance parameter specifies the percentage of allowed deviation from the color specified in src_color parameter. Its allowed values are whole numbers from 0 to 100.
The default value is: 0.
Example:
smooth
Smooth parameter tells the program to smooth color transitions in modified areas of the image. Its allowed values are:
- yes - smooth color transitions.
- no - do not smooth color transitions.
The default value is: yes.
Example:
general example
ICPCL.exe -convertto tiff "C:\Source Images\*.*" -dest "C:\out" dither:no -oper ReplaceColor src_color:"r:255,g:0,b:0,a:0" ReplaceColor dest_color:"r:255,g:255,b:255,a:255" src_color:"r:0,g:255,b:0,a:0" dest_color:"r:255,g:255,b:255,a:255" ReplaceColor src_color:"r:255,g:255,b:255,a:255" dest_color:"r:0,g:255,b:0,a:0"