Creates palette with MaxColors based on the colors of images in Images array.
function MakePaletteForImages(var Images: TDynImageDataArray; Pal: PPalette32; MaxColors: LongInt; ConvertImages: Boolean): Boolean;
Imaging (at line 204)
Use it when you want to convert several images to indexed format using single palette for all of them. If ConvertImages is True images in array are converted to indexed format using resulting palette. if it is False images are left intact and only resulting palatte is returned in Pal. Pal must be allocated to have at least MaxColors entries.