public static byte [ ] compress ( byte [ ] data , int width , int height ) { CCITTG4Encoder g4 = new CCITTG4Encoder ( width ) ; g4 . fax4Encode ( data , 0 , g4 . rowbytes * height ) ; return g4 . close ( ) ; }
Encodes a full image .