diff --git a/ChangeLog b/ChangeLog index 665b3b7a..002bc384 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ - support TIFF CIELAB images with alpha [angelmixu] - support TIFF with premultiplied alpha in any band - block metadata changes on shared images [pvdz] +- RGB and sRGB are synonmous 17/9/19 started 8.8.4 - improve compatibility with older imagemagick versions diff --git a/libvips/colour/colourspace.c b/libvips/colour/colourspace.c index 3779ce6f..1b05545d 100644 --- a/libvips/colour/colourspace.c +++ b/libvips/colour/colourspace.c @@ -493,9 +493,7 @@ static VipsColourRoute vips_colour_routes[] = { * vips_colourspace_issupported: * @image: input image * - * Test if @image is in a colourspace that vips_colourspace() can process. For - * example, #VIPS_INTERPRETATION_RGB images are not in a well-defined - * colourspace, but #VIPS_INTERPRETATION_sRGB ones are. + * Test if @image is in a colourspace that vips_colourspace() can process. * * Returns: %TRUE if @image is in a supported colourspace. */ diff --git a/libvips/colour/icc_transform.c b/libvips/colour/icc_transform.c index 9dab23c5..1caa8a58 100644 --- a/libvips/colour/icc_transform.c +++ b/libvips/colour/icc_transform.c @@ -282,7 +282,7 @@ vips_icc_build( VipsObject *object ) case cmsSigRgbData: colour->interpretation = icc->depth == 8 ? - VIPS_INTERPRETATION_RGB : + VIPS_INTERPRETATION_sRGB : VIPS_INTERPRETATION_RGB16; colour->format = icc->depth == 8 ? diff --git a/libvips/foreign/fits.c b/libvips/foreign/fits.c index b3a74df7..73c9a584 100644 --- a/libvips/foreign/fits.c +++ b/libvips/foreign/fits.c @@ -326,7 +326,7 @@ vips_fits_get_header( VipsFits *fits, VipsImage *out ) if( format == VIPS_FORMAT_USHORT ) type = VIPS_INTERPRETATION_RGB16; else - type = VIPS_INTERPRETATION_RGB; + type = VIPS_INTERPRETATION_sRGB; } else type = VIPS_INTERPRETATION_MULTIBAND; diff --git a/libvips/foreign/magick2vips.c b/libvips/foreign/magick2vips.c index 3338dc26..d97b1c1f 100644 --- a/libvips/foreign/magick2vips.c +++ b/libvips/foreign/magick2vips.c @@ -377,14 +377,8 @@ parse_header( Read *read ) im->Type = VIPS_INTERPRETATION_B_W; break; - case RGBColorspace: - if( im->BandFmt == VIPS_FORMAT_USHORT ) - im->Type = VIPS_INTERPRETATION_RGB16; - else - im->Type = VIPS_INTERPRETATION_RGB; - break; - case sRGBColorspace: + case RGBColorspace: if( im->BandFmt == VIPS_FORMAT_USHORT ) im->Type = VIPS_INTERPRETATION_RGB16; else diff --git a/libvips/foreign/magick7load.c b/libvips/foreign/magick7load.c index 5c0ceb76..d729db9b 100644 --- a/libvips/foreign/magick7load.c +++ b/libvips/foreign/magick7load.c @@ -477,14 +477,8 @@ vips_foreign_load_magick7_parse( VipsForeignLoadMagick7 *magick7, out->Type = VIPS_INTERPRETATION_B_W; break; - case RGBColorspace: - if( out->BandFmt == VIPS_FORMAT_USHORT ) - out->Type = VIPS_INTERPRETATION_RGB16; - else - out->Type = VIPS_INTERPRETATION_RGB; - break; - case sRGBColorspace: + case RGBColorspace: if( out->BandFmt == VIPS_FORMAT_USHORT ) out->Type = VIPS_INTERPRETATION_RGB16; else diff --git a/libvips/foreign/openslide2vips.c b/libvips/foreign/openslide2vips.c index 5a5a8c9f..0bae2657 100644 --- a/libvips/foreign/openslide2vips.c +++ b/libvips/foreign/openslide2vips.c @@ -332,7 +332,7 @@ readslide_attach_associated( ReadSlide *rslide, VipsImage *image ) openslide_get_associated_image_dimensions( rslide->osr, *associated_name, &w, &h ); vips_image_init_fields( associated, w, h, 4, VIPS_FORMAT_UCHAR, - VIPS_CODING_NONE, VIPS_INTERPRETATION_RGB, 1.0, 1.0 ); + VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB, 1.0, 1.0 ); vips_image_pipelinev( associated, VIPS_DEMAND_STYLE_THINSTRIP, NULL ); @@ -494,7 +494,7 @@ readslide_parse( ReadSlide *rslide, VipsImage *image ) } vips_image_init_fields( image, w, h, 4, VIPS_FORMAT_UCHAR, - VIPS_CODING_NONE, VIPS_INTERPRETATION_RGB, 1.0, 1.0 ); + VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB, 1.0, 1.0 ); for( properties = openslide_get_property_names( rslide->osr ); *properties != NULL; properties++ ) diff --git a/libvips/foreign/ppmload.c b/libvips/foreign/ppmload.c index dbadb67c..adcfbaca 100644 --- a/libvips/foreign/ppmload.c +++ b/libvips/foreign/ppmload.c @@ -313,8 +313,6 @@ vips_foreign_load_ppm_parse_header( VipsForeignLoadPpm *ppm ) else { if( ppm->format == VIPS_FORMAT_USHORT ) ppm->interpretation = VIPS_INTERPRETATION_RGB16; - else if( ppm->format == VIPS_FORMAT_UINT ) - ppm->interpretation = VIPS_INTERPRETATION_RGB; else ppm->interpretation = VIPS_INTERPRETATION_sRGB; } diff --git a/libvips/iofuncs/header.c b/libvips/iofuncs/header.c index c02f6326..6c77497a 100644 --- a/libvips/iofuncs/header.c +++ b/libvips/iofuncs/header.c @@ -443,12 +443,12 @@ vips_image_guess_format( const VipsImage *image ) break; case VIPS_INTERPRETATION_sRGB: + case VIPS_INTERPRETATION_RGB: format = VIPS_FORMAT_UCHAR; break; case VIPS_INTERPRETATION_XYZ: case VIPS_INTERPRETATION_LAB: - case VIPS_INTERPRETATION_RGB: case VIPS_INTERPRETATION_CMC: case VIPS_INTERPRETATION_LCH: case VIPS_INTERPRETATION_HSV: @@ -519,8 +519,7 @@ vips_image_get_interpretation( const VipsImage *image ) return( image->Type ); } -/* Try to pick a sane value for interpretation, assuming Type has been set - * incorrectly. +/* Try to guess a sane value for interpretation. */ static VipsInterpretation vips_image_default_interpretation( const VipsImage *image ) @@ -529,7 +528,7 @@ vips_image_default_interpretation( const VipsImage *image ) case VIPS_CODING_LABQ: return( VIPS_INTERPRETATION_LABQ ); case VIPS_CODING_RAD: - return( VIPS_INTERPRETATION_RGB ); + return( VIPS_INTERPRETATION_sRGB ); default: break; } @@ -578,7 +577,7 @@ vips_image_guess_interpretation( const VipsImage *image ) break; case VIPS_CODING_RAD: - if( image->Type != VIPS_INTERPRETATION_RGB ) + if( image->Type != VIPS_INTERPRETATION_sRGB ) sane = FALSE; break; diff --git a/libvips/iofuncs/image.c b/libvips/iofuncs/image.c index e8fdec3c..d4836f06 100644 --- a/libvips/iofuncs/image.c +++ b/libvips/iofuncs/image.c @@ -230,9 +230,8 @@ * three-band float image of type #VIPS_INTERPRETATION_LAB should have its * pixels interpreted as coordinates in CIE Lab space. * - * These values are set by operations as hints to user-interfaces built on top - * of VIPS to help them show images to the user in a meaningful way. - * Operations do not use these values to decide their action. + * RGB and sRGB are treated in the same way. Use the colourspace functions if + * you want some other behaviour. * * The gaps in numbering are historical and must be maintained. Allocate * new numbers from the end. @@ -959,7 +958,7 @@ vips_image_build( VipsObject *object ) if( image->Bands == 1 ) image->Type = VIPS_INTERPRETATION_B_W; else if( image->Bands == 3 ) - image->Type = VIPS_INTERPRETATION_RGB; + image->Type = VIPS_INTERPRETATION_sRGB; else image->Type = VIPS_INTERPRETATION_MULTIBAND; @@ -992,7 +991,7 @@ vips_image_build( VipsObject *object ) if( image->Bands == 1 ) image->Type = VIPS_INTERPRETATION_B_W; else if( image->Bands == 3 ) - image->Type = VIPS_INTERPRETATION_RGB; + image->Type = VIPS_INTERPRETATION_sRGB; else image->Type = VIPS_INTERPRETATION_MULTIBAND; @@ -3093,7 +3092,7 @@ vips_image_ispartial( VipsImage *image ) * @image: image to check * * Look at an image's interpretation and see if it has extra alpha bands. For - * example, a 4-band #VIPS_INTERPRETATION_RGB would, but a six-band + * example, a 4-band #VIPS_INTERPRETATION_sRGB would, but a six-band * #VIPS_INTERPRETATION_MULTIBAND would not. * * Return %TRUE if @image has an alpha channel.