Dec-27-2021, 07:03 AM
(Dec-27-2021, 03:03 AM)kucingkembar Wrote: but when I tried it using random jpeg pictures, the result is not good,Well, if you throw away all colors except 1 and replace that with black...
It's not a work of art that is going to emerge.
Except if what you really want is to convert a picture into Black & white.
That is a slightly different ptocedure. The simplest form is to do x = (R+G+B)/3
for every pixel. R=x,G=x,B=x
It could also be that you are attempting a B&W conversion, using only the red channel.
That is possible, but then you need to do R=R, G=R, B=R
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.