code: def test_quantize_no_dither2():
      im = Image.new("RGB", (9, 1))
      im.putdata([(p,) * 3 for p in range(0, 36, 4)])
  
      palette = Image.new("P", (1, 1))
      data = (0, 0, 0, 32, 32, 32)
      palette.putpalette(data)
      quantized = im.quantize(dither=Image.Dither.NONE, palette=palette)
  
      assert tuple(quantized.palette.palette) == data
  
      px = quantized.load()
      for x in range(9):
          assert px[x, 0] == (0 if x < 5 else 1)
  
file_path: pillow/Tests/test_image_quantize.py
imports: from __future__ import annotations
  import pytest
  from packaging.version import parse
  from PIL import Image, features
  from .helper import assert_image_similar, hopper, is_ppc64le, skip_unless_feature
label_desc: Use image node_id 7 for calling a global function with example usage: test_quantize_no_dither2() without return types