BMP Image Compression and Decompression in java -
i searching way compress , decompress bmp image in java.
i found easy way using javax.imageio , following tutorial .
using following 2 classes (imagewriter , imagewriteparam) , example provided compressing image .
what looking use same classes , same mechanism decompress "my compressed image" got provided example .
is there anyway same mechanism ?
any other solution compress bmp welcome .
thanks in advance.
the simplest ways read , write images in java using imageio, using read
, write
static methods directly.
read:
bufferedimage image = imageio.read(new file("input.bmp"));
write:
bufferedimage image = ...; // disk or created in memory, etc if (!imageio.write(image, "bmp", new file("output.bmp"))) { // todo: handle not written case }
using imagereader
, imagereadparam
, , imagewriter
, imagewriteparam
respectively (as in tutorial), gives more control on parts of image decode, size or region, or format features such compression type, quality encode etc., if need it.
Comments
Post a Comment