src/main/java/ch/wetwer/moviefleur/helper/ImageHelper.java
/**
     * @param sourceImage image to convert
     * @param type        encoding type to convert to
     *
     * @return converted {@link BufferedImage} in given encoding
     */
@param sourceImage image to convert
@param type        encoding type to convert to

@return converted  BufferedImage in given encoding
@param sourceImage image to convert @param type encoding type to convert to @return converted BufferedImage in given encoding
public static BufferedImage convertToType(BufferedImage sourceImage, int type) {
        if (sourceImage.getType() == type) {
            return sourceImage;
        } else {
            BufferedImage image = new BufferedImage(sourceImage.getWidth(), sourceImage.getHeight(), type);
            image.getGraphics().drawImage(sourceImage, 0, 0, null);
            return image;
        }
    }
public static BufferedImage convertToType ( BufferedImage sourceImage , int type ) { if ( sourceImage . getType ( ) == type ) { return sourceImage ; } else { BufferedImage image = new BufferedImage ( sourceImage . getWidth ( ) , sourceImage . getHeight ( ) , type ) ; image . getGraphics ( ) . drawImage ( sourceImage , 0 , 0 , null ) ; return image ; } }
@param sourceImage image to convert
 @param type        encoding type to convert to
@param sourceImage image to convert @param type encoding type to convert to