Automatic picture resize for badges?

HI,

in javascript customize I use background-size: contain to not have to resize all my pictures manually for each Tile in HA.

Can we do something like that in regular jinja templates too:

right now I have this:

    entity_picture_template: >
      {% if is_state('sensor.espresso_water_level','Off') %} local/buttons/button_power_off.png
      {% elif is_state('sensor.espresso_water_level','Needs refill') %} /local/various/watertap.png
      {% else %} /local/activities/opstaan75.png
      {% endif %}

opstaan.jpg is a full size picture, needed for my Tiles, and I want that to be of fine resolution, so don’t want to scale down, but let HA take care of that in resizing automatically. So when viewing on larger screens, images still have detail.

In the above jinja template I needed to resize manually, (the larger file wasn’t displayed at all, or maybe it was But I only saw a white badge and hence now need to have several files of the same picture in various resolution.

please have a look in the jinja vocabulary?