Why are we dividing with 255.0?

in the draw img function why did we divide with 255.0

Hey @itzsakshi26gupta, dividing by 255 basically normalizes your image. So if you have an image , its pixels values are in the range of 0 to 255. If you divide by 255 the range can be described with a 0.0-1.0 where 0.0 means 0 (0x00) and 1.0 means 255 (0xFF).

Also there are many other uses of normalization which you could easily find over the internet.
If you feel there is any doubt , feel free to raise a new doubt on the portal anytime !

Happy Learning :slight_smile:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.