if (image != null)
{
LosslessImage losslessImage = new LosslessImage(image);
int width = losslessImage.getWidth();
int height = losslessImage.getHeight();
DefineBitsLossless defineBits = DefineBitsLosslessBuilder.build(losslessImage.getPixels(), width, height);
defineTags.defineBitsLossless2(defineBits);
DefineShape ds3 = ImageShapeBuilder.buildImage(defineBits, defineBits.width, defineBits.height);
defineTags.defineShape3(ds3);
applyBounds(ds3.bounds.xMin, ds3.bounds.yMin, ds3.bounds.xMax, ds3.bounds.yMax);