def METHOD_NAME(imglog, result):
    if not imglog.enabled:
        return
    template = """\
        <h4>is_screen_black: {{result.black}}</h4>
        {{ annotated_image(non_black_region) }}
        {% if "mask" in images %}
        <h5>Mask:</h5>
        <img src="mask.png" />
        {% endif %}
        <h5>Grayscale, masked:</h5>
        <img src="gray.png">
        <ul>
          <li>Maximum pixel intensity: {{maxVal}}
          <li>threshold={{threshold}}
        </ul>
        {% if not result.black %}
        <h5>Non-black pixels in region:</h5>
        <img src="non_black.png" />
        {% endif %}
    """
    imglog.html(template, result=result)