Sorry coming again to the same... but may be this help others... too.. searching the web found the following:
Here at IDRSolutions we have been working on our Java PDF Library and JPDF2HTML5 solutions since 1999 and more recently with Images. How did this happen? Well you have ever needed to read or write …
ps
fcourse jDeli is very expensive !!!!
But searching little found that also
opencv has options to encode bufferedimage to the memory... I think
@JordiCP .. already know if it is better... but for sure as i am reading it (has a difficulty, mat, etc)...
And something else that found was that... but i didn't checked...
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
public byte[] toByteArray(BufferedImage image) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(baos);
encoder.encode(image);
return baos.toByteArray();
}
...read about com.sun.image.codec ... that will depreceated... but i am not sure... also i am not sure if it is ok to use them at b4j and create commercial software (if needed)
other solution will Apache Commons Imaging... but no java example for them too..
so we have:
jDeli... very expensive
Sun image codecs ... i didn;t try... not sure if working and if will work tomorrow... also.. what about their license
opencv
JAI ... Java Advance Imaging has imageio... and many talking that is better ? but why?
Apache Commons..
too many options but... which is faster and free
need little more searching.. my eyes are "playing"... need a sleep
ps: also found that gif encoding will be much better for my scope... as the bytes using is 1/4 --> no need million of colors