logical() true is white, false is black for imshow
The conversion to uint8 is uint8(0.3*255) and that rounds upon conversion. 76.5 would round to 77. But remember that the calculation is double precision and 0.3 is not exactly 3/10 so for some values it is potentially possible that an expected mathematical outcome ending in 0.5 might be 1 bit short of 0.5 exactly, so there could potentially be a few values that uint8 differently than you would naively expect
Best Answer