As stated here in this article, there is a bug with MapnikRasterizer. this transformer unlike imageRasterizer gives the option to change color of line, text, polygon etc. If using MapnikRasterizer is not possible how can I customize the color of the lines and the text before imageRasterizering.
That would be FeatureColorSetters like you've used before. However, I would try the fixes suggested in that article on the MapnikRasterizer bug too. Probably tiling (using a Tiler) and then mosaicking afterwards would be the best solution. The MapnikRasterizer has a Group By parameter, if you set that to the _column and _row attributes coming out of the Tiler and potentially set parallel processing too it could save you memory and time.