Use the function Document.changeMode() with the mode set to ChangeMode.INDEXDCOLOR and IndexedConversionOptions with the number of colors set to 16. Then call it again with the mode set to ChangeMode.RGB (or ChangeMode.BITMAP as needed).
-X
Use the function Document.changeMode() with the mode set to ChangeMode.INDEXDCOLOR and IndexedConversionOptions with the number of colors set to 16. Then call it again with the mode set to ChangeMode.RGB (or ChangeMode.BITMAP as needed).
-X