MATLAB makes people process image quite easily, so I used MATLAB to finish it. Here is my code :
% secret : matrix made of hidden infomation
% carrier: matrix made of pixel
% extract: matrix to store hidden information
% N: position, usually equaling 1
carrier = bitor( bitand(carrier, bitcmp(2^N-1, 8)), secret );
extract = uint8( bitand( 255, bitshift(carrier, 8-N)));
P.S. To implement a function, you might need dec2bin() mat2str() bin2dec() for support.

