void php_bw_jpg_from_rep_ratio(string mpq_dir, string replay_path, string output_path, int ratio, int quality=REPASM_LOW_QUALITY, int jpeg_quality=90, int rendering_mode=RENDER_ALL)
php_bw_jpg_from_rep_ratio creates an image file specified by the output_path variable from the replay file that was found at rep_path using the specified ratio. On jpg_from_rep functions, starting locations are visible only for actual players. Others (observers' starting locations, for example) are not rendered. Here's a description of each parameter :
- mpq_dir : the DIRECTORY containing stardat.mpq and broodat.mpq. Note the lower-case names, they're important if you're on Unix, your MPQ files must be named that way.
- replay_path : the COMPLETE PATH to the replay file you want to generate a minimap from.
- output_path : the COMPLETE PATH to the image file you want to create. If a file already exists at that location, it will be overwritten.
- ratio : an integer specifying the factor you want to reduce the map of. It must not be lower than 1. For example, a ratio of 8 will reduce the map to 1/8th of its full size IN PIXELS. For a 128x128 map like LT or Luna, the full size in pixels is 4096x4096 ; therefore, an 8 ratio will result in a 512x512 image.
- quality : the rendering quality. Can either be REPASM_LOW_QUALITY (default) or REPASM_HIGH_QUALITY. See also the guide on how to use minimap functions properly.
- jpeg_quality : the QUALITY level (and not the compression level), in %, of the image you want to generate. For example, a jpeg_quality value of 90 will output a nice image while a value of 10 will result in a poor quality image. Of course, the worse jpeg_quality is, the smaller the file is. Default is 90.
- rendering_mode : the objects you want to see on your minimap. See the Rendering mode predefined constants to have a list of what your parameter can be. You can combine different constants using the | operator. Example : if you want to display both starting locations and resources on your image but not doodads or additional units, your rendering_mode parameter will be : RENDER_STARTING_LOCATIONS|RENDER_RESOURCES. Default is RENDER_ALL.
See example here