The Microsoft Windows Imaging Component (WIC) provides an extensible framework for working with images and image metadata.
WIC makes it possible for independent software vendors (ISVs) and independent hardware vendors (IHVs) to develop their own image codecs and get the same platform support as standard image formats (for example, TIFF, JPEG, PNG, GIF, BMP, and WMPhoto).
A single, consistent set of interfaces is used for all image processing, regardless of image format, so any application using the WIC gets automatic support for new image formats as soon as the codec is installed.
The extensible metadata framework makes it possible for applications to read and write their own proprietary metadata directly to image files, so the metadata never gets lost or separated from the image.
This topic includes the following sections.
Windows Imaging Component Features
The primary features of WIC are:
- Enables application developers to perform image processing operations on any image format through a single, consistent set of common interfaces, without requiring prior knowledge of specific image formats.
- Provides an extensible "plug and play" architecture for image codecs, pixel formats, and metadata, with automatic run-time discovery of new formats. See the AITCodec Sample CODEC for an extensible codec example.
- Supports reading and writing of arbitrary metadata in image files, with the ability to preserve unrecognized metadata during editing.
- Preserves high bit depth image data, up to 32 bits per channel, throughout the image processing pipeline.
- Provides built-in support for most popular image formats, pixel formats, and metadata schemas.
Imaging Components
The WIC APIs provide several types of imaging components.
| Component Type | Description |
|---|
| Clipper | A clipper can be used to impose a rectangular clip region on an image. When asked for pixels, the clipper will only return pixels which are within the clip rectangle. The clipper component allows the imaging pipeline to reference small parts of other components without the need for making copies of the data. |
| Color Context | A color context is an abstraction for an International Color Consortium (ICC) color profile. Many images contain embedded (and sometimes external) color profiles which describe the color capabilities of a device (camera, scanner) with which they were created. |
| Color Transform | A color transform is used to convert pixels from one color context to another. For example, if the output of the imaging pipeline is a display, this API allows you to convert between a source (e.g, camera) color context and a target (e.g, display) color context. |
| Decoder | A decoder is used to decode image data from a stream into a format that is useful for image processing. Decoding may involve uncompressing, decrypting, and/or altering the image bits in various ways prior to handing back the bits to the application. Since some codecs use proprietary technology to achieve better compression and image fidelity, the details on how an image gets decoded are determined by the codec requirements. Codecs are typically composed of both a decoder and encoder. |
| Encoder | An encoder writes image data to a stream. Encoders may compress, encrypt, and alter the image pixels in various ways prior to writing them to the stream. Since some codecs use proprietary technology to achieve better compression and image fidelity, the details on how an image gets encoded are determined by the codec requirements. Codecs are typically composed of both a decoder and encoder. |
| Frame | A frame is the representation of a particular image within the image container. Some image formats support multi-frame images. |
| Palette | A palette is a collection of colors represented within a particular image. Palettes have varying numbers of colors. Usually, a palette is used in combination with indexed pixel formats. For example, instead of storing an RGB triplet for each pixel, only the index into the palette is stored. Halftone palettes are usually optimized for a particular device (display, printer, and so on). They are intended to provide the best possible image quality with a reduced set of colors. Optimal palettes are generated from an image's pixel values - usually using a histogram. |
| Pixel Format Converter | A format converter is used to convert from one pixel format to another. The pixel formats used by the codec systems are chunky; that is, the individual channels (R,G,B) are interlaced with one another in a given scanline, as opposed to being saved in separate planes. |
| Scaler | A scaler is used to scale (or resample) an image to a new size. Scalers are useful for generating thumbnails of an image. |
| Stream | A stream is used to read and write data from a file, network resource, a block of memory, and so on. It serves as a common abstraction for a data source and provides methods such as read and write. |
Native Codecs
WIC includes several built-in codecs. The following standard codecs are provided with the platform.
| Codec | Mime Types | Decoders | Encoders |
|---|
| BMP (Windows Bitmap Format), BMP Specification v5. | image/bmp | Yes | Yes |
| GIF (Graphics Interchange Format 89a), GIF Specification 89a/89m | image/gif | Yes | Yes |
| ICO (Icon Format) | image/ico | Yes | No |
| JPEG (Joint Photographic Experts Group), JFIF Specification 1.02 | image/jpeg, image/jpe, image/jpg | Yes | Yes |
| PNG (Portable Network Graphics), PNG Specification 1.2 | image/png | Yes | Yes |
| TIFF (Tagged Image File Format), TIFF Specification 6.0 | image/tiff, image/tif | Yes | Yes |
| Windows Media Photo, HD Photo Specification 1.0 | image/vnd.ms-phot | Yes | Yes |