profile - Manipulate embedded profiles

- NAME
- SYNOPSIS
- FUNCTION DESCRIPTIONS

- DeleteImageProfile
- GetImageProfile
- ProfileImage
- SetImageProfile

# NAME

profile - Manipulate embedded profiles

# SYNOPSIS

unsigned int DeleteImageProfile( Image *image, const char *name );

const unsigned char * GetImageProfile( const Image *image, const char *name, size_t *length );

unsigned int ProfileImage( Image *image, const char *name, const unsigned char *profile, const size_t length, unsigned int clone );

unsigned int SetImageProfile( Image *image, const char *name, const unsigned char *profile, const size_t length );

# FUNCTION DESCRIPTIONS

## DeleteImageProfile

DeleteImageProfile removes a named profile from the image.

The format of the DeleteImageProfile method is:

> unsigned int DeleteImageProfile ( Image *image, const char *name );

A description of each parameter follows:

image:

  The image.

name:

  Profile name. Valid names are ``8BIM'', ``ICM'', & ``IPTC'' or a generic profile name.

## GetImageProfile

GetImageProfile returns a pointer to the named image profile if it is present. A null pointer is returned if the named profile is not present.

The format of the GetImageProfile method is:

> const unsigned char *GetImageProfile ( const Image *image, const char *name, size_t *length );

A description of each parameter follows:

image:

  The image.

name:

  Profile name. Valid names are ``8BIM'', ``ICM'', & ``IPTC'' or an existing generic profile name.

length:

  Updated with profile length if profile is present.

## ProfileImage

> ProfileImage() adds, applies, or removes a ICM, IPTC, or generic profile from an image. If the profile is NULL, it is removed from the image otherwise added ( or applied ) . Use a name of ' *' and a profile of NULL to remove all profiles from the image. Ownership of the profile is transferred to GraphicsMagick ( it should not be altered or deallocated ) unless the clone option is set to True.

ICC ICM profiles are a special case and are handled as follows:

If there is no ICM profile currently associated with the image, then the profile is simply associated with the image and the image pixels are not altered.

If there is already a ICM profile associated with the image, then the colorspace transform described by the existing and new profiles is applied to the image pixels, and the new profile is associated with the image.

The format of the ProfileImage method is:

> unsigned int ProfileImage ( Image *image, const char *name, const unsigned char *profile, const size_t length, unsigned int clone );

A description of each parameter follows:

image:

  The image.

name:

  Name of profile to add or remove: ICM, IPTC, or generic profile.

profile:

  The profile.

length:

  The length of the profile.

clone:

  If set True, then copy the profile rather than taking ownership of it.

## SetImageProfile

SetImageProfile adds a named profile to the image. If a profile with the same name already exists, then it is replaced. If a null profile address is supplied, then an existing profile is removed. The profile is copied into the image. Note that this function does not execute CMS color profiles. Any existing CMS color profile is simply replaced. Use the `ProfileImage()` function in order to execute a CMS color profile.

The format of the SetImageProfile method is:

> unsigned int SetImageProfile ( Image *image, const char *name, const unsigned char *profile, const size_t length );

A description of each parameter follows:

image:

  The image.

name:

  Profile name. Valid names are ``8BIM'', ``ICM'', & ``IPTC'' or an generic profile name.

profile:

  Address of profile to add. Pass zero to remove an existing profile.

length:

  The length of the profile.