code: def test_subsample(self):
      # This test shows advantages of the subpixel resizing
      # after supersampling (e.g. during JPEG decoding).
      with Image.open("Tests/images/flower.jpg") as im:
          assert im.size == (480, 360)
          dst_size = (48, 36)
          # Reference is cropped image resized to destination
          reference = im.crop((0, 0, 473, 353)).resize(
              dst_size, Image.Resampling.BICUBIC
          )
          # Image.Resampling.BOX emulates supersampling (480 / 8 = 60, 360 / 8 = 45)
          supersampled = im.resize((60, 45), Image.Resampling.BOX)
  
      with_box = supersampled.resize(
          dst_size, Image.Resampling.BICUBIC, (0, 0, 59.125, 44.125)
      )
      without_box = supersampled.resize(
          dst_size, Image.Resampling.BICUBIC
      )
  
      # error with box should be much smaller than without
      assert_image_similar(reference, with_box, 6)
      with pytest.raises(AssertionError, match=r"difference 29\."):
          assert_image_similar(reference, without_box, 5)
  
imports: from __future__ import annotations
  from contextlib import contextmanager
  import pytest
  from PIL import Image, ImageDraw
  from .helper import assert_image_equal, assert_image_similar, hopper, mark_if_feature_version
label_desc: Use image node_id 4 for calling the TestCoreResampleBox obj's underlying member method code with example usage: obj.test_subsample() without return types