final boolean isPngAuto = isPng
&& parameters.getSpritePngDepth() == PngDepth.AUTO;
final boolean isPngDirect = isPng
&& parameters.getSpritePngDepth() == PngDepth.DIRECT;
final ColorReductionInfo colorReductionInfo = ColorQuantizer
.getColorReductionInfo(sprite);
final boolean canReduceWithoutQualityLoss = colorReductionInfo
.canReduceWithoutQualityLoss();
final BufferedImage [] result = new BufferedImage [2];
if (isPngDirect || (isPngAuto && !canReduceWithoutQualityLoss) || isJpg)