Ejemplo n.º 1
0
 /// <summary>
 /// Calculates the colour table needed to index the supplied pixels.
 /// </summary>
 /// <param name="colourQuantizationQuality">
 /// Sets quality of color quantization (conversion of images
 /// to the maximum 256 colors allowed by the GIF specification).
 /// Lower values (minimum = 1) produce better colors, but slow
 /// processing significantly.  10 is the default, and produces
 /// good color mapping at reasonable speeds.  Values greater
 /// than 20 do not yield significant improvements in speed.
 /// Defaults to 1 if not greater than zero.
 /// </param>
 private void CreateColourTableUsingNeuQuant(int colourQuantizationQuality)
 {
     byte[] rgb = ImageTools.GetRgbArray(_imageColours);
     _nq          = new NeuQuant(rgb, colourQuantizationQuality);
     _colourTable = _nq.Process();             // create reduced palette
 }
Ejemplo n.º 2
0
		/// <summary>
		/// Calculates the colour table needed to index the supplied pixels.
		/// </summary>
		/// <param name="colourQuantizationQuality">
		/// Sets quality of color quantization (conversion of images
		/// to the maximum 256 colors allowed by the GIF specification).
		/// Lower values (minimum = 1) produce better colors, but slow
		/// processing significantly.  10 is the default, and produces
		/// good color mapping at reasonable speeds.  Values greater
		/// than 20 do not yield significant improvements in speed.
		/// Defaults to 1 if not greater than zero.
		/// </param>
		private void CreateColourTableUsingNeuQuant( int colourQuantizationQuality )
		{
			byte[] rgb = ImageTools.GetRgbArray( _imageColours );
			_nq = new NeuQuant( rgb, colourQuantizationQuality );
			_colourTable = _nq.Process(); // create reduced palette
		}