Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compression size #11

Open
jobartim44 opened this issue Dec 3, 2020 · 2 comments
Open

Compression size #11

jobartim44 opened this issue Dec 3, 2020 · 2 comments

Comments

@jobartim44
Copy link

Hi, i'am trying to use the lib to automaticaly convert jpg files to webp to obtain smaller files. My problem is that the output file is the same weight even if it smaller in size (I previously resized the picture).

image

I'am doing this under Windows system with this code :

ImageWriter writer = ImageIO.getImageWritersByMIMEType("image/webp").next();

WebPWriteParam writeParam = new WebPWriteParam(writer.getLocale());
writeParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
writeParam.setCompressionType(writeParam.getCompressionTypes()[WebPWriteParam.LOSSLESS_COMPRESSION]);

writer.setOutput(new FileImageOutputStream(outputFile));

writer.write(null, new IIOImage(bufferedImage, null, null), writeParam);
@jobartim44
Copy link
Author

And the original file

FAR03005NB

@lambdaupb
Copy link

You won't get good results with WebPWriteParam.LOSSLESS_COMPRESSION, it means WebP can't really compress much.

joostoudeman pushed a commit to joostoudeman/webp-imageio that referenced this issue Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants