number_transparent = 0;
number_semitransparent = 0;
- if (image->storage_class != PseudoClass && mng_info->write_png_colortype &&
+ if (mng_info->write_png_colortype &&
(mng_info->write_png_colortype > 4 || (mng_info->write_png_depth >= 8 &&
mng_info->write_png_colortype < 4 &&
image->alpha_trait != BlendPixelTrait)))
}
}
- else
+ if (mng_info->write_png_colortype < 7)
{
/* BUILD_PALETTE
*
image_colors=(int) image->colors;
image_matte=image->alpha_trait == BlendPixelTrait ? MagickTrue : MagickFalse;
- mng_info->IsPalette=image->storage_class == PseudoClass &&
- image_colors <= 256 && image->colormap != NULL;
+ if (mng_info->write_png_colortype > 4)
+ mng_info->IsPalette=image->storage_class == PseudoClass &&
+ image_colors <= 256 && image->colormap != NULL;
+ else
+ mng_info->IsPalette = MagickFalse;
if ((mng_info->write_png_colortype == 4 || mng_info->write_png8) &&
(image->colors == 0 || image->colormap == NULL))
mng_info->write_png_colortype = /* 6 */ 7;
mng_info->write_png_depth = 8;
image->depth = 8;
+ image->alpha_trait == BlendPixelTrait;
- if (image->alpha_trait == BlendPixelTrait)
- (void) SetImageType(image,TrueColorMatteType,exception);
-
- else
- (void) SetImageType(image,TrueColorType,exception);
-
+ (void) SetImageType(image,TrueColorMatteType,exception);
(void) SyncImage(image,exception);
}
mng_info->write_png_colortype = /* 6 */ 7;
mng_info->write_png_depth = 16;
image->depth = 16;
+ image->alpha_trait == BlendPixelTrait;
- if (image->alpha_trait == BlendPixelTrait)
- (void) SetImageType(image,TrueColorMatteType,exception);
-
- else
- (void) SetImageType(image,TrueColorType,exception);
-
+ (void) SetImageType(image,TrueColorMatteType,exception);
(void) SyncImage(image,exception);
}