def test_image_resolution(assert_same_renderings):
    assert_same_renderings(
        '''
            <style>@page { size: 20px; margin: 2px }</style>
            <div style="font-size: 0">
                <img src="pattern.png" style="width: 8px"></div>
        ''',
        '''
            <style>@page { size: 20px; margin: 2px }</style>
            <div style="image-resolution: .5dppx; font-size: 0">
                <img src="pattern.png"></div>
        ''',
        '''
            <style>@page { size: 20px; margin: 2px }
                   div::before { content: url(pattern.png) }
            </style>
            <div style="image-resolution: .5dppx; font-size: 0"></div>
        ''',
        '''
            <style>@page { size: 20px; margin: 2px }
            </style>
            <div style="height: 16px; image-resolution: .5dppx;
                        background: url(pattern.png) no-repeat"></div>
        ''',
    )
<style>@page { size: 20px; margin: 2px }</style>
<div style="font-size: 0">
<img src="pattern.png" style="width: 8px"></div>
''',
tests/draw/test_image.py