
Construct color via ImageMagick QuantumĬonst Color& operator= ( Quantum &color_ ) * virtual */ operator std::string() const Set color via SVG color specification stringĬonst Color& operator= ( const std::string & svgColor_ ) Ĭonst Color& operator= ( const char * svgColor_ ) Ĭolor& operator= ( const Color& color_ ) Scaled (to 1.0) version of alpha for use in sub-classes Alpha level (range OpaqueOpacity=0 to TransparentOpacity=MaxRGB)

Color may also be converted to a std::string for convenience in user interfaces, and for saving settings to a text file. Since the class may be constructed from a string, convenient strings may be passed in place of an explicit Color object in methods which accept a reference to Color. The Color class contains a pointer to a Quantum, which may be allocated by the Color class, or may refer to an existing pixel in an image.Īn alternate way to construct the class is via an SVG-compatible color specification string (e.g. Color arguments are must be scaled to fit the Quantum size. Normally a user will construct a derived class or inherit from this class. The Color base class is not intended to be used directly. The following table shows the relationship between QuantumDepth, the type of Quantum, and the overall Quantum size. If additional color precision or range is desired, then ImageMagick may be compiled with QuantumDepth=16 or QuantumDepth=32.
#Imagemagick replace color 32 bit
The default is 32 bit pixels (QuantumDepth=8), which provides the best performance and the least resource consumption.

This is controlled by the value of the QuantumDepth define. ImageMagick may be compiled to support 32, 64, or 128 bit pixels of type Quantum. Quantum is the internal representation of a pixel in ImageMagick. The QuantumDepth build option determines the number of bits in a Quantum. The maximum value that a Quantum can attain is specified by a constant value represented by the MaxRGB define, which is itself determined by the number of bits in a Quantum.

For example, an RGB pixel contains red, green, and blue quantums, while an RGBA pixel contains red, green, blue, and opacity quantums. Pixels are represented by a structure of Quantum values. The base type used to represent color samples in ImageMagick is the Quantum type. The Color class may be constructed directly from an SVG-style color string. Normally users will instantiate a class derived from Color which supports the color model that fits the needs of the application. It is a simple container class for the pixel red, green, blue, and alpha values scaled to fit ImageMagick's Quantum size. Color is the base color class in Magick++.
