Is there any Java libraries like packjpg? http://www.elektronik.htw-aalen.de/packjpg/index.htm
Basically its for highly compressing(23%) jpeg in lossless form.
After the search I couldn’t find anything that really would help me.
Nothing of the top charts are in Java: http://www.maximumcompression.com/data/jpg.php
But an application called Image Optimizer Pro helped optimises jpegs quite small enough with little quality loss but using something like packjpg would of gotten them a lot smaller.
Also there is a program called jpeg reducer helped optimise jpegs (lossless), which is already built in Image Optimizer Pro. I used it on my photo collection to get 10%+ reduction.
It is possible to have loss-less JPG in Java as well, if you disable the chroma subsampling and set quality to 100%, you should get a lossless compressed image.
[quote]It is possible to have loss-less JPG in Java as well, if you disable the chroma subsampling and set quality to 100%, you should get a lossless compressed image.
[/quote]
I’m talking about lossless jpeg compression not lossless jpegs.
Does it have to be lossless jpg? Regular png encoding is lossless and should be better than lossless jpeg.
Alternatively some googling suggests that the java-advanced-imaging API supports it, but I hear that JAI is a bit of a pain when it comes to distribution.
[quote]Does it have to be lossless jpg? Regular png encoding is lossless and should be better than lossless jpeg.
[/quote]
I was looking for more ways to compress a jpeg in a zip like container without loosing quality, only a number of special formats can compress jpeg even more which none are supported by Java.
I also looked at WebP, Googles new web image format, but there is no support really for it atm(and no Java version).
[…] would of gotten […]
Dude. Seriously.
–
I recommend to use jpegtran.
jpegtran -copy none -optimize -outfile out.jpg in.jpg
This discards all meta/exif data and it also tries to optimize the huffman tables (this is lossless).
In extreme cases that optimize step can save as much as 50%, but it can also make the file slightly bigger. E.g. if you save for web with Photoshop, the JPGs will be already pretty much optimal. So, check the file size.