Specifies the default dithering method to use when converting an image from 64, 48, 32, 24, or 16 bits per pixel to 8 bits per pixel or fewer.


#include "ltwrappr.h"

static L_INT LBitmapSettings::DefaultDithering(uMethod)


L_UINT uMethod

The dithering method to use. Possible values are:

Value Meaning
NO_DITHERING [0] Use no dithering.
FLOYD_STEIN_DITHERING [1] Use the Floyd-Steinberg method.
BURKES_DITHERING [3] Use the Burkes method.
STUCKI_DITHERING [2] Use the Stucki method.
SIERRA_DITHERING [4] Use the Sierra method.
STEVENSON_ARCE_DITHERING [5] Use the Stevenson-Arce method.
JARVIS_DITHERING [6] Use the Jarvis method.
ORDERED_DITHERING [7] Use ordered dithering, which is faster than other methods but is lower in quality.
CLUSTERED_DITHERING [8] Use clustered dithering.


Value Meaning
SUCCESS The function was successful.
< 0 An error occurred. Refer to Return Codes.


Some LEADTOOLS functions automatically dither an image when necessary for display. Those functions use the default dithering method that this function specifies.

For general information about dithering, refer to Color Resolution and Dithering.

Color Resolution: Burkes Dithering Function - Before

Color Resolution: Burkes Dithering Function - Before

Color Resolution: Burkes Dithering Function - After

Color Resolution: Burkes Dithering Function - After

View additional platform support for this Color Resolution: Burkes Dithering function.

Required DLLs and Libraries


Win32, x64.

See Also




L_INT LBitmapSettings__DefaultDitheringExample(HWND hWnd) 
   L_INT nRet; 
   LBitmapSettings bitmapSettings; 
   LBitmap         LeadBitmap; 
   // Set the default dithering  
  nRet =LBitmapSettings::DefaultDithering(NO_DITHERING); 
  if(nRet < 0) 
     return nRet; 
   // Load the bitmap at 8 bits per pixel  
  nRet = LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp")), 8, ORDER_BGR); 
  if(nRet !=SUCCESS) 
     return nRet; 
   // Update the paint palette 
   SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L); 
   return SUCCESS; 
Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help