What's New in WIC for Windows 8.1
Windows Imaging Component (WIC) has been updated with new releases of Windows. This topic provides a quick introduction to these new features.
Starting in Windows 8.1, WIC provides support for decoding, transforming and encoding JPEG Y'CbCr image data in its native format. This allows apps to significantly decrease processing time and memory consumption for certain imaging operations when working with Y'CbCr encoded JPEGs. For more information, see the following topics:
- Direct2D YCbCr effect
- IWICPlanarBitmapSourceTransform interface
- IWICPlanarBitmapFrameEncode interface
Starting in Windows 8.1, WIC adds a new codec that supports DDS images encoded in the following formats: DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC2_UNORM, and DXGI_FORMAT_BC3_UNORM. DDS block compressed data can be accessed in a decoded form using standard WIC interfaces, or directly accessed using new DDS specific interfaces. For more information, see the following topics:
In Windows 8, WIC has been updated with several new features. The updated version of WIC is also available on Windows 7 and Windows Server 2008 R2 via the Platform Update for Windows 7, which is available through the Platform Update for Windows 7.
WIC in Windows 8 provides these APIs to improve Direct2D integration with WIC:
- IWICImageEncoder - A new interface which can encode Direct2DID2D1Image content to an IWICBitmapFrameEncode. The methods of this interface take a pointer to WICImageParameters, which are parameters to control encoding.
- IWICImagingFactory2 - New WIC factory with the CreateImageEncoder method. This interface inherits from the original WIC factory, IWICImagingFactory, and is created the same way.
WIC in Windows 8 supports loading BITMAPV5HEADER image files as WICPixelFormat32bppBGRA-formatted images. In addition, the BMP encoder supports a new Boolean ,encoder option "EnableV5Header32bppBGRA", which instructs the encoder to write a BITMAPV5HEADER with the 32bppBGRA image data.
For more info about BMP formats, see BMP Format Overview.
WIC in Windows 8 defines these new pixel formats:
When running in an AppContainer process, which includes all Windows Store apps, WIC will only use Windows-provided components, regardless of whether additional components are installed on the system. App that are not running in AppContainer are not affected.
Apps don't need to make any code changes to run in an AppContainger, but the WICComponentEnumerateOptions flag and vendor GUID parameters will have no effect. WIC will fail to load an image if it cannot be decoded by a Windows provided codec, and calling the CreateComponentEnumerator method will only return Windows provided components.
CLSID_WICPngDecoder1 has been added with the same GUID as CLSID_WICPngDecoder, and CLSID_WICPngDecoder2 has been added.
When compiled against the Windows 8 SDK, CLSID_WICPngDecoder is #defined to CLSID_WICPngDecoder2 to promote newly compiled apps using the new PNG decoder behavior. Apps should continue to specify CLSID_WICPngDecoder.
Specifying CLSID_WICPngDecoder2 will create a version of the WIC PNG decoder that will generate an IWICColorContext from cHRM and gAMA chunks. This allows this color space metadata to be used with other Windows APIs for color managing the source image. An IWICColorContext is not generated from the gAMA and cHRM chunks if an iCCP chunk is present, if an sRGB chunk is present, or if the gAMA and cHRM chunks indicate an sRGB color space.
An app can specify CLSID_WICPngDecoder1 to create a version of the WIC PNG decoder that does not generate an IWICColorContext from the gAMA and cHRM chunks. This matches the behavior of the PNG decoder in previous versions of Windows.
When compiled against the Windows 8 SDK, WINCODEC_SDK_VERSION is #defined to WINCODEC_SDK_VERSION2 to promote newly compiled apps using the new PNG decoder behavior. Otherwise, it is #defined to WINCODEC_SDK_VERSION1. Apps should continue to specify WINCODEC_SDK_VERSION.
Specifying WINCODEC_SDK_VERSION when calling WICCreateImagingFactory_Proxy to create the imaging factory causes CLSID_WICPngDecoder2 to be created instead of CLSID_WICPngDecoder1 from the CreateDecoder method and its variants. Also, a decoder component info enumerator will return CLSID_WICPngDecoder2 component info, but not CLSID_WICPngDecoder1 info.
Specifying WINCODEC_SDK_VERSION1 will cause CLSID_WICPngDecoder1 to be used instead of CLSID_WICPngDecoder2 in the above cases.
CLSID_WICImagingFactory1 has been added with the same GUID as CLSID_WICImagingFactory, and CLSID_WICImagingFactory2 has been added.
When compiled against the Windows 8 SDK, CLSID_WICImagingFactory is #defined to CLSID_WICImagingFactory2 to promote newly compiled apps using the new PNG decoder behavior. Apps should continue to specify CLSID_WICImagingFactory.
Specifying CLSID_WICImagingFactory2 when calling CoCreateInstance to create the imaging factory causes CLSID_WICPngDecoder2 to be created instead of CLSID_WICPngDecoder1 from the CreateDecoder method and its variants. Also, a decoder component info enumerator will return CLSID_WICPngDecoder2 component info, but not CLSID_WICPngDecoder1 info.
Specifying CLSID_WICImagingFactory1 will cause CLSID_WICPngDecoder1 to be used instead of CLSID_WICPngDecoder2 in the above cases.
In Windows 7, WIC has been updated with several new features. This topic provides a quick introduction to these new features.
The WIC TIFF codec has been updated for Windows 7 to support several features not supported by the previous version of WIC.
- Support for large TIFF files.
- Decode tiled TIFF images.
- Decode flat (planar) TIFF images.
- Decode JPEG encoded TIFF images.
Progressive decoding provides the ability to incrementally decode and render portions of an image before the entire image has finished downloading. This feature greatly improves the user experience when viewing images from the Internet, because the user does not have to wait for the entire image to download before decoding can begin. With progressive decoding, users are able to see an image preview with available data long before the entire image is downloaded. This feature is essential for any application used to view images from the Internet or from data sources with limited bandwidth.
For more information, see the Progressive Decoding Overview.
In Windows 7, WIC has extended its metadata support for JPEG, PNG, and GIF images.
- Added support for animated GIF and GIF properties.
- Expanded JPG metadata handlers to support chrominance, luminance, and comment metadata.
- Expanded PNG metadata handlers to support tIME, sRGB, iCCP, hIST, cHRM, iTXt, bKGD, and gAMA metadata.
- Added new 8BIM metadata handlers for ResolutionInfo metadata and IPTC digest metadata.
- Added new metadata handlers for Logical Screen Descriptor (LSD), Image Descriptor (IMD), Graphic Control Extensions (GCE), and Application Extensions (APE) metadata.
- Support for metadata that spans APPn blocks.
Objects within a multithreaded apartment (MTA) may be called concurrently by any number of threads within the MTA, allowing for better performance on multicore systems and certain server scenarios. In addition, WIC codecs that live within an MTA can call other objects that live within the MTA without the marshaling cost associated of calling between threads that live in different STA apartments. In Windows 7, all in-box WIC codecs have been updated to support MTA, including JPEG, TIFF, PNG, GIF, ICO, and BMP. It is highly recommended that codecs be written to support MTA. Codecs that do not support MTA will cause significant performance degredation in multithreaded applications due to marshaling. Enabling MTA support requires proper synchronization to be implemented in the codec. Exact implementation of these synchronization techniques is beyond the scope of this paper. A general reference for synchronizing Component Object Model (COM) objects is provided below.
There are currently a variety of metadata storage formats that contain overlapping properties, without any clear industry standard or guidance on consistent methods for reading and writing these metadata formats. To help with this variety of formats and properties, the Metadata Working Group (MWG) was formed. The aim of the MWG is to provide guidelines that ensure interoperability among a wide variety of platforms, applications, and devices. The guidelines established by the MWG apply to the XMP, Exif, and IPTC metadata fields, and to the JPEG, TIFF, and PSD image formats.
In Windows 7, the photo metadata handler and the metadata policy layer have been updated to read and write image metadata according to the guidelines established by the MWG. For more information on the Metadata Working Group (MWG) and the established metadata guidelines, visit the Metadata Working Group Web site.
The Platform Update for Windows Vista is a set of run-time libraries that enables developers to target applications to both Windows 7 and Windows Vista. The Platform Update for Windows Server 2008 is a set of run-time libraries that enables developers to target applications to both Windows Server 2008 R2 and Windows Server 2008. The Platform Update for Windows Vista and the Platform Update for Windows Server 2008 will be available to all Windows Vista and Windows Server 2008 customers through Windows Update. Third-party applications that require Platform Update for Windows Vista or Platform Update for Windows Server 2008 can have Windows Update detect whether the required updated is installed; if it is not, Windows Update will download and install it in the background. For more information about both updates, see Platform Update for Windows Vista