PDF Images are not what you seem to expect. So lets take one sample, but all inserts can be done differently (otherwise there would be no need for different extraction apps). PDF was not designed for splitting retrospectively, many objects were simplified for toner ink for transfer on usually white paper, thus transparency was an afterthought, needing 4th version (%PDF-1.4++)
Here is a file with nothing other than what appears to be a single transparent image. Note it says its object 19, but there is nothing else!

Lets query what is in the file with poppler utility since most python libraries depend on that or GhostScript.
Poppler\poppler-22.04.0\Library\bin>pdfimages -list tt.pdf
page num type width height color comp bpc enc interp object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------
1 0 image 950 575 gray 1 8 image no 27 0 72 72 42.4K 7.9%
1 1 image 950 575 index 1 8 image no 19 0 72 72 2454B 0.4%
1 2 smask 950 575 gray 1 8 image no 19 0 72 72 42.4K 7.9%
What we can now see is there are 3 images and 2 of them are number 19, so now we see there are two images 27 and 19 but 19 also has an overlay (softMask).
This is where PDF cannot store a RGBA file as one object but it needs split in to RGB image and a Greytone for the transparency. so here are the 2 images viewed in a graphics viewer. And many libraries need some IMage library to blend them back into one PNG.

An alternative library is MuPDF
MuPDF\1.20.0-tesseract>mutool extract -a tt.pdf
extracting image-0019.png
extracting image-0020.png
extracting image-0027.png

The simplest cli extractor is thus MuPDF so PyMuPDF should be able to export a similar blend. (However since I use single line programs without the overheads python imposes, I cant confirm the code needed in this specific case.)
Side Note that using a different image extractor that should maintain transparency provided a different view of contents and extracted the transparent image plus a smaller thumbnail, which on looking at producer (Adobe Illustrator) explains much of the differing graphics issues.
pdfcpu_0.3.12>pdfcpu images list tt.pdf
pages: all
2 images available
page obj# id type width height colorspace comp bpc interp size filters
=========================================================================
1 19 Im0 smask 950 575 Indexed 3 8 2 KB FlateDecode
13 thumb 105 57 Indexed 3 8 171 ASCII85Decode,FlateDecode
<xmp:Thumbnails>
<rdf:Alt>
<rdf:li rdf:parseType="Resource">
<xmpGImg:width>256</xmpGImg:width>
<xmpGImg:height>156</xmpGImg:height>
<xmpGImg:format>JPEG</xmpGImg:format>
...
<photoshop:LayerText>Testing</photoshop:LayerText>
...
<rdf:li>Cyan</rdf:li>
<rdf:li>Magenta</rdf:li>
<rdf:li>Yellow</rdf:li>
<rdf:li>Black</rdf:li>
...
<</BC 23 0 R/G 24 0 R/S/Luminosity/Type/Mask>>
In fact there were several references to masks !