code: def test_PIL_to_bytes(self):
      image = Image.new("RGB", (128, 128))
  
      # test with quality=None
      PIL_to_bytes(image)
  
      # test with quality=90
      PIL_to_bytes(image, quality=90)
  
      # test with quality=90 and ext=jpg
      PIL_to_bytes(image, ext="JPEG", quality=90)
  
file_path: lightly/tests/api/test_utils.py
imports: import os
  import unittest
  from unittest import mock
  import pytest
  from PIL import Image
  from lightly.api.utils import DatasourceType, PIL_to_bytes, get_lightly_server_location_from_env, get_signed_url_destination, getenv, paginate_endpoint, retry
label_desc: Use image node_id 5 for calling the TestUtils obj's underlying member method code with example usage: obj.test_PIL_to_bytes() without return types