diff --git a/src/PIL/Image.py b/src/PIL/Image.py
index 51d6e8466..f1a83c47c 100644
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -1096,7 +1096,13 @@ class Image(object):
             im = self.im.convert("P", dither, palette.im)
             return self._new(im)
 
-        return self._new(self.im.quantize(colors, method, kmeans))
+        im = self._new(self.im.quantize(colors, method, kmeans))
+
+        from . import ImagePalette
+        mode = im.im.getpalettemode()
+        im.palette = ImagePalette.ImagePalette(mode, im.im.getpalette(mode, mode))
+
+        return im
 
     def copy(self):
         """
diff --git a/src/libImaging/Unpack.c b/src/libImaging/Unpack.c
index e9921d2ca..ccfeabaf9 100644
--- a/src/libImaging/Unpack.c
+++ b/src/libImaging/Unpack.c
@@ -1331,6 +1331,7 @@ static struct {
     {"RGB",     "BGR;5",        16,     ImagingUnpackBGR15}, /* compat */
     {"RGB",     "RGBX",         32,     copy4},
     {"RGB",     "RGBX;L",       32,     unpackRGBAL},
+    {"RGB",     "RGBA;L",       32,     unpackRGBAL},
     {"RGB",     "BGRX",         32,     ImagingUnpackBGRX},
     {"RGB",     "XRGB",         24,     ImagingUnpackXRGB},
     {"RGB",     "XBGR",         32,     ImagingUnpackXBGR},

Quantize should update palette
### What did you do?
```python 
# t.png - png image with transparency.
im = Image.open('t.png')
print (im.info['transparency'])
# '\x00\x0f#Af\x99\xce\xfc\xfd\xc1\xdd\x86\xfdk\x94>^#\xcd\xc6\xe2\xb8\xda\xb0\x8c\xaba'
im_rgba = im.convert()
im_p = im_rgba.quantize()
new_im_rgba = im_p.convert()
print (new_im_rgba.mode)
```
### What did you expect to happen?
'RGBA'
### What actually happened?
'RGB'
### What versions of Pillow and Python are you using?
latest master

I noticed [there is code to handle](https://github.com/python-pillow/Pillow/pull/537/files#diff-3fef5f960d5bd8bdfb9c6fadcf96af22R737) that in `convert` for RGB -> P conversion. Looks like it was used for RGBA->P conversion as well, but then RGBA->P got [handled by call to quantize directly](https://github.com/python-pillow/Pillow/pull/573).

diff --git a/Tests/test_image_quantize.py b/Tests/test_image_quantize.py
index 762b4bcab..5f2318574 100644
--- a/Tests/test_image_quantize.py
+++ b/Tests/test_image_quantize.py
@@ -38,9 +38,10 @@ class TestImageQuantize(PillowTestCase):
 
     def test_rgba_quantize(self):
         image = hopper('RGBA')
-        image.quantize()
         self.assertRaises(ValueError, image.quantize, method=0)
 
+        self.assertEqual(image.quantize().convert().mode, "RGBA")
+
     def test_quantize(self):
         image = Image.open('Tests/images/caption_6_33_22.png').convert('RGB')
         converted = image.quantize()

pip install -e .[dev]
parse_log_pytest
requirements.txt
apt-get update apt-get install -y gcc libjpeg-dev zlib1g-dev libtiff5-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev libharfbuzz-dev libfribidi-dev libxcb1-dev
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.16
babel==2.17.0
blessed==1.20.0
build==1.2.2.post1
certifi==2025.1.31
charset-normalizer==3.4.1
check-manifest==0.50
cov-core==1.15.0
coverage==7.8.0
coveralls==4.0.1
docopt==0.6.2
docutils==0.21.2
exceptiongroup==1.2.2
idna==3.10
imagesize==1.4.1
importlib_metadata==8.6.1
iniconfig==2.1.0
jarn.viewdoc==2.7
Jinja2==3.1.6
MarkupSafe==3.0.2
olefile==0.47
packaging==24.2
-e git+https://github.com/python-pillow/Pillow.git@21ff4114bd285a42ccbc53be5441b014f95f72fc#egg=Pillow
pluggy==1.5.0
pycodestyle==2.13.0
pyflakes==3.3.1
Pygments==2.19.1
pyproject_hooks==1.2.0
pyroma==4.2
pytest==8.3.5
pytest-cov==6.0.0
pytz==2025.2
requests==2.32.3
six==1.17.0
snowballstemmer==2.2.0
Sphinx==7.4.7
sphinx-rtd-theme==3.0.2
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
tomli==2.2.1
trove-classifiers==2025.3.19.19
urllib3==2.3.0
wcwidth==0.2.13
zipp==3.21.0

name: Pillow
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.16
      - babel==2.17.0
      - blessed==1.20.0
      - build==1.2.2.post1
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - check-manifest==0.50
      - cov-core==1.15.0
      - coverage==7.8.0
      - coveralls==4.0.1
      - docopt==0.6.2
      - docutils==0.21.2
      - exceptiongroup==1.2.2
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - jarn-viewdoc==2.7
      - jinja2==3.1.6
      - markupsafe==3.0.2
      - olefile==0.47
      - packaging==24.2
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pyflakes==3.3.1
      - pygments==2.19.1
      - pyproject-hooks==1.2.0
      - pyroma==4.2
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - pytz==2025.2
      - requests==2.32.3
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==7.4.7
      - sphinx-rtd-theme==3.0.2
      - sphinxcontrib-applehelp==2.0.0
      - sphinxcontrib-devhelp==2.0.0
      - sphinxcontrib-htmlhelp==2.1.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==2.0.0
      - sphinxcontrib-serializinghtml==2.0.0
      - tomli==2.2.1
      - trove-classifiers==2025.3.19.19
      - urllib3==2.3.0
      - wcwidth==0.2.13
      - zipp==3.21.0
prefix: /opt/conda/envs/Pillow

Tests/test_image_quantize.py::TestImageQuantize::test_rgba_quantize
Tests/test_image_quantize.py::TestImageQuantize::test_octree_quantize Tests/test_image_quantize.py::TestImageQuantize::test_quantize Tests/test_image_quantize.py::TestImageQuantize::test_quantize_dither_diff Tests/test_image_quantize.py::TestImageQuantize::test_quantize_no_dither Tests/test_image_quantize.py::TestImageQuantize::test_sanity
src/libImaging/Unpack.c src/PIL/Image.py
src/libImaging/Unpack.c src/PIL/Image.py