I propose an extra 'quality' parameter that ranges from 0 to 100 like usual. This value could then be passed along to the JPG engine to set the quality treshold.
This value could also be passed to the PNG engine. PNG is a lossless format, but the value would reflect how much time the PNG engine spends to compress the image before it reaches the treshold.
Additionally, I also request a boolean 'subsampling' parameter to enable or disable JPG chroma subsampling (Im not sure if this is enabled by default in the JPG engine factorio uses but it usually is enabled by default.). This will help avoid the colors in the JPG image being much more "washed out"
Example: Both of these screenshots were taking with zoom=1 (small zoom values are also broken, but thats a topic for another day, probably nofix anyway). I have scaled them up by 800% (without interpolation) for ease of viewing.
JPG output:
![Image](https://forums.factorio.com/images/ext/8ffa9a3f6fa67b127c82bd8c433738e5.jpg)
PNG output:
![Image](https://forums.factorio.com/images/ext/31073c439f0f8fc9224a108372a2573c.png)