Is there a simple way to convert an Image to a byte[] without saving any file? I tried with
ImageIO.write(ImageUtilities.createBufferedImage(output), "jpg", baos);
but the result was an image with a high red drift.
You seem to have CSS turned off. Please don't fill out this field.
Anonymous
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageUtilities.write(output, "jpg", baos) byte[] bytes = baos.toByteArray();
View and moderate all "General Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Is there a simple way to convert an Image to a byte[] without saving any file?
I tried with
but the result was an image with a high red drift.
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageUtilities.write(output, "jpg", baos)
byte[] bytes = baos.toByteArray();