--- In [email protected], "John Matthews" <jm5...@...> wrote:
>
> --- In [email protected], Jos Timanta Tarigan <jos_t_tarigan@> wrote:
> >
> > the problem is i want to merge two image and merging the value of each 
> > pixel. so basically pixel1 + pixel2 / 2.0;
> > the problem is each of these pixels is char. how can I convert it to float 
> > and then convert it back to char again?
> 
> Why do you need to convert to float? How about:
> 
>     char pixel1, pixel2, newPixel;
> 
>     newPixel = (pixel1 + pixel2) / 2;
>
Wouldn't you want to "or" them together?
also instead of the "/2" use " >> 1" its faster with less overhead.

Reply via email to