code: def test__new(self):
      im = hopper("RGB")
      im_p = hopper("P")
  
      blank_p = Image.new("P", (10, 10))
      blank_pa = Image.new("PA", (10, 10))
      blank_p.palette = None
      blank_pa.palette = None
  
      def _make_new(base_image, im, palette_result=None):
          new_im = base_image._new(im)
          assert new_im.mode == im.mode
          assert new_im.size == im.size
          assert new_im.info == base_image.info
          if palette_result is not None:
              assert (
                  new_im.palette.tobytes() == palette_result.tobytes()
              )
          else:
              assert new_im.palette is None
  
      _make_new(
          im, im_p, ImagePalette.ImagePalette(list(range(256)) * 3)
      )
      _make_new(im_p, im, None)
      _make_new(im, blank_p, ImagePalette.ImagePalette())
      _make_new(im, blank_pa, ImagePalette.ImagePalette())
  
imports: import io
  import os
  import shutil
  import sys
  import tempfile
  import pytest
  from PIL import Image, ImageDraw, ImagePalette, UnidentifiedImageError
  from .helper import assert_image_equal, assert_image_equal_tofile, assert_image_similar_tofile, assert_not_all_same, hopper, is_win32, mark_if_feature_version, skip_unless_feature
label_desc: Use image node_id 43 for calling the TestImage obj's underlying member method code with example usage: obj.test__new() without return types