How to change one color to another?
Image Converter Plus
Image Converter Plus Home FeaturesDownloadOrderSupport

Introduction of ImageConverter Plus command line
Program Overview
Program Features
Comand line syntax
Script
Makebat
Source
Convertto
BMP
JPG
GIF
PNG
TGA
TIFF
PSD
EXR
DDS
PDF
EPS
MNG
Dest
Save_opt
Template
Target_opt
Add operations (-oper)
Crop
Effect
Mirror
Resize
Rotate
Replace_color
Canvas
Color_profile
Watermark
Page_filter
Sort
How to...
Launching the program
Launch the program?
Launch the program from BATCH-file?
Launch the program from another application?
Use ImageConverter Plus command line on Web-server?
Launch the program from PERL script under Windows server?
Launch the program from Cold Fusion?
Launch the program from ASP?
Hide concole window when I launch the program from my application?
Working with files and folders
Convert files from local network?
Convert files from folder with all subfolders?
Specify name of output file?
Delete source images after conversion?
Overwrite files?
Convert CALS Raster files to TIFF?
Convert DICOM image file into TIFF?
Convert PCX file into TIFF?
Convert PDF file into TIFF in batch mode?
Convert SFF files into TIFF?
Convert TIFF file with Wang OldJPEG compression into standard TIFF?
Convert WinFax files into TIFF?
Convert WPG clipart into TIFF?
Convert color image into grayscale TIFF?
Convert Group3 and Group4 Fax files into TIFF format?
Changing image size and resolution
Stretch image proportionally?
Change image resolution?
Change image size and keep resolution?
Working with border and margins
Crop white margins from photo and fax?
Add a solid border to all images?
Working with colors and transparency
Change one color to another?
Invert colors?
Convert file with CMYK color space?
Make colors transparent?
Other questions
Save each page of multipage file separately?
Find out what version of batch converter you have?
Convert TIFF file with rotation?
Create a multipage file?
Find out numeric color code?
Additional Information
Color effects
Features in details
Supported formats
Registration and licensing
License agreement
Order ImageConverter Plus
fCoder On-line
About
Online support form
Custom development

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:

-oper ReplaceColor src_color:"r:255,g:255,b:0,a:100"

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:

 

-oper ReplaceColor dest_color:"r:0,g:255,b:0,a:100"

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:

 

-oper ReplaceColor tolerance:5

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:

 

-oper ReplaceColor smooth:no

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"


In this example we changed red and blue color to green. If you don't know how to find out numeric color code, read this section.

© 2007, fCoder Group, Inc.
Site Map | Other Projects