void php_bw_jpg_from_rep_dim(string mpq_dir, string replay_path, string output_path, int max_size, int quality=REPASM_LOW_QUALITY, int jpeg_quality=90, int rendering_mode=RENDER_ALL)
php_bw_jpg_from_rep_dim creates an image file specified by the output_path variable from the replay file that was found at rep_path using the specified size. 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.
- max_size : an integer specifying the size of your image IN PIXELS. For a square map, a max_size of 1024 will result in a 1024x1024 image. But for a rectangular map, only the biggest side will be 1024 while the other side will be smaller. For example, for a 256x128 (tiles) map, the output image will be 1024x512 (pixels).
- 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