png.writeHeader(width, height, pngBitDepth, pngColorType);
if (icc != null)
png.writeIccProfile(icc);
if (palette != null)
png.writePalette(palette);
png.writeData(imageBytes, stride);
png.writeEnd();
streamContentType = ImageBytesType.PNG;
imageBytes = ms.toByteArray();
}
}