In my application I transfer a lot of images from server to client. The problem is the size of the image, so I tried to encode it using this encoder - objectplanet png encoder. The problem is nothing seems to happen, image size is the same.
//img is a BufferedImage object PngEncoder pngenc; ByteArrayOutputStream baos = new ByteArrayOutputStream(); pngenc.setCompression(PngEncoder.COLOR_GRAYSCALE_ALPHA);//this doesn't seem to work pngenc.encode(img, baos);//write encoded image to stream... not working? baos.flush();
Does anybody knows why is not compressing the image? ...and is PNG the best transfer option? (for speed)