On the riddle in JuliaAcademy lesson "Representing data in a computer"

I filtered out the white background in apples and bananas,

iswhite(pixel) = (Float64( red(pixel) ) > 0.9 
               && Float64( green(pixel) ) > 0.9 
               && Float64( blue(pixel) ) > 0.9)

applewhitearray = iswhite.(apple)
applewhitemask = [ RGB{N0f8}(i, i, i) for i in applewhitearray]
display(apple)
display(applewhitemask)
display(apple[.!applewhitearray])

bananawhitearray = iswhite.(banana)
bananawhitemask = [ RGB{N0f8}(i, i, i) for i in bananawhitearray]
display(banana)
display(bananawhitemask)
display(banana[.!bananawhitearray])



and surprisingly, there is still a lot of red in the banana:

display(histogram(float.(red.(apple[.!applewhitearray])),color="red",label="apple", normalize=true, nbins=25))
histogram!(float.(red.(banana[.!bananawhitearray])),color="yellow",label="banana", normalize=true, nbins=25)

and the mean redness of the banana is still bigger.

println("Apple has average redness ", mean(Float64.(red.(apple[.!applewhitearray]))))
println("Banana has average redness ", mean(Float64.(red.(banana[.!bananawhitearray]))))
Apple has average redness 0.4411
Banana has average redness 0.6242
1 Like