API Documentation > CorelDRAW > 2025-v26 > Bitmap > IVGBitmap
Bitmap.ConvertToPaletted method
Converts the bitmap to a paletted image using the specified parameters
Syntax:
Sub ConvertToPaletted(ByVal PaletteType As cdrImagePaletteType, Optional ByVal DitherType As cdrDitherType = cdrDitherNone, Optional ByVal DitherIntensity As Long = 100, Optional ByVal Smoothing As Long = 0, Optional ByVal NumColors As Long = 256, Optional ByVal ColorSensitive As Boolean = False, Optional ByVal TargetColor As Long = 16777215, Optional ByVal Importance As Long = 500, Optional ByVal Lightness As Long = 300, Optional ByVal ToleranceA As Long = 300, Optional ByVal ToleranceB As Long = 100, Optional ByRef Palette As Variant)
Parameters:
Name Type Description
PaletteType
DitherType
Specifies the type of dithering to apply.
DitherIntensity
Long
Specifies the intensity of the dithering.
Smoothing
Long
Specifies the type of smoothing to apply.
NumColors
Long
Specifies the maximum number of colors in the optimized image. The PaletteType must be optimized for this option to be applied.
ColorSensitive
Boolean
Specifies whether color sensitivity is applied.
TargetColor
Long
Specifies the color to which the color sensitivity is applied.
Importance
Long
Specifies the emphasis of the sensitivity of the target color. The TargetColor must be specified for this option to be applied.
Lightness
Long
Specifies the lightness of the range sensitivity.
ToleranceA
Long
Specifies the tolerance of the range sensitivity on the green-red axis.
ToleranceB
Long
Specifies the tolerance of the range sensitivity on the blue-yellow axis.
Palette
Variant
Remarks:
The ConvertToPaletted method converts the bitmap to a specific palette using the specified parameters.
Examples:
The following VBA example converts all bitmaps on the active page to the Optimized palette.
Sub Test()
Dim s As Shape
For Each s In ActivePage.Shapes
  If s.Type = cdrBitmapShape Then

 If s.Bitmap.Mode <> cdrPalettedImage Then


s.Bitmap.ConvertToPaletted cdrPaletteOptimized, cdrDitherNone, , 5

 End If
  End If
Next s 
End Sub