@Override
    public String toString() {
        try {
            final StringWriter sw = new StringWriter();
            final PrintWriter pw = new PrintWriter(sw);

            toString(pw, "");
            pw.flush();

            return sw.toString();
        } catch (final Exception e) {
            return "Image Data: Error";
        }
    }
Returns true if the image has transparency.

@return {@code true} if the image has transparency, {@code false} otherwise.
src/main/java/org/apache/commons/imaging/ImageInfo.java