That's doable with BGRABitmap.
There is a Resample function that resizes to any width/height. So you would need to multiply/divide both by the same number to preserve the aspect ratio.
Then with the TBGRAColorQuantizer class of the unit BGRAColorQuantization, you can specify the number of colors and save it. This makes sense for PNG 256 colors and BMP 16 colors or 256 colors. Note that sometimes, a 24bit PNG file is smaller than a 256 colors PNG file.
For JPG, the way is not quantization but to specify the quality. You can specify by creating a writer (class is defined in FPWriteJPEG), set its CompressionQuality property, and then pass it as a parameter when calling SaveToFile.