{% for body in bodies %}{
  "image": "{{ body.name }}",
  "width": {{ body.size.width }},
  "height": {{ body.size.height }},
  "polygons": [{% for fixture in body.fixtures %}{% for polygon in fixture.polygons %}{% if not forloop.parentloop.first or not forloop.first %},{% endif %}
    [{% for point in polygon %}{% if not forloop.first %}, {% endif %}[{{ point.x }}, {{ point.y }}]{% endfor %}]{% endfor %}{% endfor %}
  ]
}{% endfor %}
