diff --git a/libvips/foreign/vipspng.c b/libvips/foreign/vipspng.c index 89c65b50..5d980425 100644 --- a/libvips/foreign/vipspng.c +++ b/libvips/foreign/vipspng.c @@ -490,6 +490,11 @@ png2vips_header( Read *read, VipsImage *out ) return( -1 ); } + /* Attach original palette bit depth, if any, as metadata. + */ + if( color_type == PNG_COLOR_TYPE_PALETTE ) + vips_image_set_int( out, "palette-bit-depth", bit_depth ); + return( 0 ); }