Does Aspose java imaging components work with BufferdImage? I have a list of Bufferedimage(s) that needs to be converted to multipage TIFF using JPEG compression, and it needs to be quick (currently I use JAI which is slow). I’d like to evaluate Aspose but examples only show how to load image from disk in bmp or jpeg format. Is there any way to use BufferedImage directly? What are alternatives?
Thanks.
Hi Dario,
Thanks for your inquiry. I’ve logged an investigation ticket as IMAGING-33618 in our issue tracking system for investigating your requirement. We are looking into your query and will get back to you soon.
Best Regards,
Hi Dario,
I’ve further investigated your requirements, You can convert BufferedImage to bytes array and then convert it to InputStream. Later, use load() constructor with InputStream parameter, please check following code snippet. Hopefully it will serve the purpose.
BufferedImage originalImage = ImageIO.read(new File(myDir+“input.png”));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write( originalImage, “png”, baos );
baos.flush();
byte[] imageInByte = baos.toByteArray();
baos.close();
InputStream isImage = new ByteArrayInputStream(imageInByte);
Image image=Image.load(isImage);
image.save(myDir+“output.gif”,new com.aspose.imaging.imageoptions.GifOptions());
Please feel free to contact us for any further assistance.
Best Regards,
The issues you have found earlier (filed as IMAGING-33618) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.