Class Overview
A collection of utility methods for encoding images and returning them as a
byte[] or writing them directly to an OutputStream.
Summary
Public Methods |
static
byte[]
|
encode(BufferedImage image, String format, float quality, boolean encodeAlpha)
Encode the image in a specific format.
|
static
byte[]
|
encode(BufferedImage image, String format)
Encode the image in a specific format.
|
static
byte[]
|
encode(BufferedImage image, String format, float quality)
Encode the image in a specific format.
|
static
byte[]
|
encode(BufferedImage image, String format, boolean encodeAlpha)
Encode the image in a specific format.
|
static
void
|
writeBufferedImage(BufferedImage image, String format, OutputStream outputStream, float quality)
Encode the image in a specific format and write it to an OutputStream.
|
static
void
|
writeBufferedImage(BufferedImage image, String format, OutputStream outputStream, float quality, boolean encodeAlpha)
Encode the image in a specific format and write it to an OutputStream.
|
static
void
|
writeBufferedImage(BufferedImage image, String format, OutputStream outputStream, boolean encodeAlpha)
Encode the image in a specific format and write it to an OutputStream.
|
static
void
|
writeBufferedImage(BufferedImage image, String format, OutputStream outputStream)
Encode the image in a specific format and write it to an OutputStream.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Public Constructors
Public Methods
public
static
byte[]
encode
(BufferedImage image, String format, float quality, boolean encodeAlpha)
Encode the image in a specific format.
Parameters
image
| The image to be encoded. |
format
| The ImageFormat to use. |
quality
| The quality to use for the image encoding (not supported
by all ImageEncoders). |
encodeAlpha
| Whether to encode alpha transparency (not supported
by all ImageEncoders). |
Returns
- The byte[] that is the encoded image.
public
static
byte[]
encode
(BufferedImage image, String format)
Encode the image in a specific format.
Parameters
image
| The image to be encoded. |
format
| The ImageFormat to use. |
Returns
- The byte[] that is the encoded image.
public
static
byte[]
encode
(BufferedImage image, String format, float quality)
Encode the image in a specific format.
Parameters
image
| The image to be encoded. |
format
| The ImageFormat to use. |
quality
| The quality to use for the image encoding (not supported
by all ImageEncoders). |
Returns
- The byte[] that is the encoded image.
public
static
byte[]
encode
(BufferedImage image, String format, boolean encodeAlpha)
Encode the image in a specific format.
Parameters
image
| The image to be encoded. |
format
| The ImageFormat to use. |
encodeAlpha
| Whether to encode alpha transparency (not supported
by all ImageEncoders). |
Returns
- The byte[] that is the encoded image.
public
static
void
writeBufferedImage
(BufferedImage image, String format, OutputStream outputStream, float quality)
Encode the image in a specific format and write it to an OutputStream.
Parameters
image
| The image to be encoded. |
format
| The ImageFormat to use. |
outputStream
| The OutputStream to write the encoded image to. |
quality
| The quality to use for the image encoding (not
supported by all ImageEncoders). |
public
static
void
writeBufferedImage
(BufferedImage image, String format, OutputStream outputStream, float quality, boolean encodeAlpha)
Encode the image in a specific format and write it to an OutputStream.
Parameters
image
| The image to be encoded. |
format
| The ImageFormat to use. |
outputStream
| The OutputStream to write the encoded image to. |
quality
| The quality to use for the image encoding (not
supported by all ImageEncoders). |
encodeAlpha
| Whether to encode alpha transparency (not supported
by all ImageEncoders). |
public
static
void
writeBufferedImage
(BufferedImage image, String format, OutputStream outputStream, boolean encodeAlpha)
Encode the image in a specific format and write it to an OutputStream.
Parameters
image
| The image to be encoded. |
format
| The ImageFormat to use. |
outputStream
| The OutputStream to write the encoded image to. |
encodeAlpha
| Whether to encode alpha transparency (not
supported by all ImageEncoders). |
public
static
void
writeBufferedImage
(BufferedImage image, String format, OutputStream outputStream)
Encode the image in a specific format and write it to an OutputStream.
Parameters
image
| The image to be encoded. |
format
| The ImageFormat to use. |
outputStream
| The OutputStream to write the encoded image to. |