mozjpeg
mozjpeg copied to clipboard
JAVA api
Hello, I could not find any option to use Java API to pass my custom quantization table (-qtable), -notrellis options. Is there any option available....
Probably not. We haven't kept the Java API up to date with MozJPEG changes.
It shouldn't be too hard to add it — have a look how other settings are implemented, and create similar methods for the missing ones.
- I will implement the same by adding flags for -notrellis in TJ class
I have another query: We want to create 3 versions of the same image at the quality level of 75, 84 and 90. Users will select the right version after visual inspection. However, it takes more then a minute for file size of approx. 3 MB. Is there any option to improve the performance. Any idea will be helpful (Other then hardware improvement)
It should take seconds, not minutes.
When you use cjpeg
command that you built yourself, is it also that slow, or is it slow only via Java API?
When i use CJPEG it takes approx. 25 seconds for 1 iteration. I have to execute 3 iterations (75, 84 & 90). Hence, approx 1 minute to complete
You should expect a speed of about 5-10 megapixels per second, so unless your image was HUUUGE, there's something wrong with your compilation.
Did you disable SIMD? Did you compile in debug mode or disable optimizations?
These were the steps
- sudo apt-get install autoconf automake libtool nasm make pkg-config git
- git clone https://github.com/mozilla/mozjpeg.git
- cd mozjpeg
- autoreconf -fiv
- ./configure --with-java
- make
Is there something missing? Let me know if i need to reinstall
That looks ok. In that case I don't understand why it's slow.
If you need 3 versions, you can run them on 3 threads. The library is single-threaded, and most CPUs are multicore, so you should get a nice 3x speedup.