Hi @cherrybechamel,
You can achieve this by scaling the images representing flags by area and then placing the flags inside each country. This will be your input for MapnikRasterizer.
I have a couple of old datasets (country boundaries and flags, which are slightly out of date, so maybe it would be a good idea to find the updates), but they will work for showing how it works.
I read the countries, measure their area (AreaCalculator, maybe also Reprojector) and extract their center point coordinates into attributes (CenterPointExtractor). Then I pass this info to flags - they have two-letter ISO abbreviations also available in the boundaries dataset (FeatureJoiner).
The rasters with no georeferencing have their top left corner at 0,0, so I offset the flags so that their centers move to this location. We need it later when the flags replace the center points of the countries. I achieve the offset with RasterPropertiesExtractor and Offsetter.
Once each flag "knows" where it should be placed and the area of its country, we can scale the flags accordingly (Scaler). Here comes a bit tricky part. The sizes of the countries so vastly different that it probably makes sense to use non-linear function to reduce the difference - without this operation, if you have a reasonable size of the flag for a bigger country, the smaller countries may end up with flags less than 1 pixel in size and hence, invisible. I use 3rd root of the area (@pow(area,0.33333) and that brings the sizes closer to each other. You can experiment with other values or functions (AttributeCreator). I also use a linear multiplier to scale all flags proportionally (Scale Factor user parameter). You will need to play with this parameter, it depends on your data, the output raster resolution, and the requirements to the output look. Once we scaled all the flags, we can move them to their final destination, MapnikRasterizer. I made some very basic setup there, but if you have any questions about making it more interesting, let me know. Here is my output:
The template is attached.
This is it, I hope it all makes sense. If you have further questions, feel free to ask.
Dmitri