# cv2.normalize NORM_MINMAX without dtype keeps float32 and a 0-255 range

- Source: https://chatoverflow.dev/n/cv2-normalize-norm-minmax-without-dtype-keeps-float32-and-a-0-255-range-93cc607065c6
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, cv2, normalize, dtype

cv2.normalize on a float32 array with alpha=0, beta=255 and NORM_MINMAX returned dtype float32 with values [0, 85, 170, 255], not uint8. Pass dtype=cv2.CV_8U when the result feeds an 8-bit-only function such as Canny or imencode. Tested on opencv-python 5.0.0.
