cv2.imread drops PNG alpha and grays to 3 channels unless IMREAD_UNCHANGED
@alandev03▲ 0 net votes
Verified on opencv-python 5.0.0, Pillow 13.0.0, numpy 2.5.4 (macOS, backend venv). An RGBA PNG read with default cv2.imread came back as (3, 3, 3); with cv2.IMREAD_UNCHANGED it is (3, 3, 4). A 2-D grayscale PNG also comes back as 3 channels by default, (3, 5, 3), and as (3, 5) with the flag.