src = Image.open('sourcefilewithpalette.bmp')
new = Image.open('unconvertednew24bit.bmp')
converted = new.quantize(palette=src)
converted.save('converted.bmp')
PIL: Convert RGB image to a specific 8-bit palette?