How WCS in Windows Vista works with Drivers and Applications Michael Stokes Microsoft Color Architect © 2006 Microsoft Corporation.

Download Report

Transcript How WCS in Windows Vista works with Drivers and Applications Michael Stokes Microsoft Color Architect © 2006 Microsoft Corporation.

How WCS in Windows Vista
works with Drivers and
Applications
Michael Stokes
Microsoft Color Architect
© 2006 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
Introduction
WCS in Windows Vista™ is
A new color management paradigm and
infrastructure
A transparent, modular, color processing pipeline
that allows for easy color troubleshooting
A new development platform for advanced color
devices and applications
A platform for innovation in color management
The first step in a staged implementation process
that will span several Windows releases
NOT MANDATORY
If it doesn’t make business sense in your workflow, if
it’s not better, don’t use it.
WCS Features
Continued, improved support for ICC-based workflows
New explicitly staged color processing pipeline
New, Simple XML Profile Formats
Easy to edit, verify, understand and extend by third parties
New Visual Model
CIECAM02 instead of reflection-print-like PCS
Built-in baseline device models for common device classes
Extensible by third party plug-in device models
Selectable gamut mapping models
Support for third party plug-in gamut mapping models for proprietary
algorithms or improvements on baseline gamut mapping models
Transforms can support black preservation
Support for high dynamic range, wide gamut, high precision color
data (up to 32 bpc float)
scRGB with a realistically defined gamut boundary (“wscRGB”)
Enables color managed proprietary and open RAW workflows
New centralized color control panel
Per-user as well as system-wide profile/device associations, defaults,
and settings
Non-Admin users can now install/uninstall profiles
New Benefits
Linear ROI Model
none
extensive
Development Investment
Legacy compatible
WCS XML data as private tags of ICC profiles
WCS processing accessible via legacy ICM2 APIs
New functionality
WCS XML data directly associated with devices
New WCS APIs sharing legacy syntax
Windows Color System and
ICC workflows
WCS still supports and defaults to the same sRGB
ICC profile as previous Windows versions
Seamless interoperability with ICC profile-based
workflows
ICC-only transforms run through improved ICM3 CMM
Mixed ICC & WCS transforms run through WCS CITE
Any existing code that uses ICM2 APIs will
continue to work without any change required
ICC Version 4 support is added to ICM
Addressing key recorded ICM bugs
Implement new functionality via current ICM2 APIs
Old applications work with new profiles
New profile format is processed by current ICM2
APIs
Compatibility Demonstrations
WCS Components
The Parts of the Windows Color System
New WCS XML-based color profile formats
Color Infrastructure & Translation Engine (CITE)
The Color Appearance Model (CAM)
Based on CIECAM02
Gamut Boundary and Gamut Shell Functions
The Baseline Device Model Set
Extensible via Device Model Plug-ins
The Baseline Gamut Map Model Set
Extensible via Gamut Map Model Plug-ins
And of course the improved ICM CMM, with ICC
version 4 profile support added
WCS Pipeline
WCS Profile Formats
Each type has its own schema
Device Model Profile (DMP), file extension “.cdmp”
A DMP targets a particular device model, either one of the built-in
“baseline” device models, or a plug-in device model
DMPs targeting plug-in device models must also specify a
baseline device model as a fallback
Color Appearance Model Profile (CAMP),
“.camp”
A CAMP provides the parameters to the CIECAM02 equations for
a specific viewing condition.
Gamut Map Model Profile (GMMP),
“.gmmp”
A GMMP targets a particular gamut mapping model, either one of
the built-in baseline gamut mapping models, or a plug-in gamut
mapping model.
As with DMPs, a GMMP that targets a plug-in GMM must also
specify a baseline gamut mapping model as a fallback.
WCS profiles are embedded in image formats as a
private tag in a WCS-created approximating ICC profile
Necessary for interoperability off of Windows Vista™
A WCS sRGB profile
WCS Device Models
WCS device models use the measurement
data from a DMP to instantiate a model
that relates device color space coordinates
to CIEXYZ
Baseline device models implement
different algorithms and processing models
for different device classes
Third parties can extend the set of device
models by writing plug-in device models
WCS Baseline Device Models
CRT Device Model
LCD Device Model
RGB Capture Device Model
RGB Projector Device Model
RGB Printer Device Model
CMYK Printer Device Model
RGB Virtual Device Model
Used for wcsRGB
ICC Virtual Device Model
Enables use of ICC profiles in WCS transforms
WCS Gamut Mapping Models (GMMs)
All gamut mapping is performed between
explicit source and destination GBD Shells
in CIECAM02 JCh
WCS Baseline Gamut Mapping Models
correspond roughly to ICC rendering
intents
Third parties can extend the set of
available GMMs by writing gamut mapping
plug-ins
WCS Baseline GMMs
Sigmoidal Gaussian Knee Clipping (SGKC)
Equivalent to ICC’s preferred, pictorial, or perceptual
intent.
Selected by Photo.gmmp
Minimum Color Difference (MinCD)
Equivalent to ICC colorimetric intents:
Relative if neutral axis mapping is done
Selected by Proofing.gmmp
Absolute without neutral axis mapping
Selected by MediaSim.gmmp
HueMap
Equivalent to ICC saturation or business graphics
intent
Selected by Graphics.gmmp
Programming WCS
Open a Color Profile
ICC or DMP filename
DMP
CAMP
GMMP
filename filename filename
OpenColorProfile()
WcsOpenColorProfile()
Default Profiles
in Registry
HPROFILE
CreateMultiProfileTransform
HTRANSFORM WINAPI CreateMultiProfileTransform(
PHPROFILE pahProfiles,
// ptr to array of HPROFILEs
DWORD nProfiles,
// number of HPROFILEs (max 10)
PDWORD padwIntent,
// ptr to array of intents
DWORD nIntents,
// number of intents (max 10)
DWORD dwFlags,
//
DWORD indexPreferredCMM
// ignored if any WCS profiles
);
pahProfiles - profile array can contain a mix of ICC and WCS profile handles
If only ICC profiles are used, processing will be via the improved ICM CMM
“WCS_ALWAYS” in dwFlags will force WCS CITE processing in all-ICC-profile case
nIntents must equal 1, nProfiles -1, or nProfiles
Intents corresponding to WCS HPROFILEs will result in the use of the corresponding
default GMMP mapped to that intent.
Intents specified in the padwIntent array trump GMMPs in WCS HPROFILEs, unless…
For WCS profiles, setting the corresponding intent in padwIntent to DWORD_MAX will
force use of GMMPs contained in WCS HPROFILEs (constructed with
WcsOpenColorProfile).
ICC DeviceLink, Abstract, and NamedColor profiles are not supported in combination
with WCS profiles.
Transform Profile Sequence Example
padwIntent
INTENT_PECEPTUAL
DWORD_MAX
HPROFILE A
HPROFILE B
HPROFILE C
DMPA
DMPB
DMPC
CAMPA
CAMPB
CAMPC
GMMPA
GMMPB
GMMPC
DMPA +CAMPA
 GBDA
Default Profiles
in Registry
DMPC +CAMPC
DMPB +CAMPB
GMMPPercep.
 GBDB
GMMPB
 GBDC
Color Control Panel
Demonstration
Demonstrations
WinHEC Demo Station #1
WinHEC Demo Station #1
Transparency
Currently, all the WCS internal design
documents are available under NDA
All algorithms are published for WCS in
Windows Vista™ in MSDN
Legacy compatible APIs and Data formats
Office12 compatibility
Adobe CS2 compatibility
Vista Picture Gallery compatibility
10bpc content to hardware
EIZO NANAO R31c medical imaging display
WinHEC Demo Station #2
WinHEC Demo Station #2
WCS advantages in 8bpc workflows
Wide Gamut
Supports very wide DSC and working space gamuts such as
ProPhoto without clipping
High Dynamic Range
Supports RGB virtual device space for values above diffuse
white (and below reference black)
WCS advantages in >8bpc workflows
Visual difference in currently shipping hardware
NEC wide gamut 10bpc display, ATI x1300 and Nikon D1x
WCS eliminate contour artifacts due to ICC HDR limitations
WinHEC Demo Station #3
WinHEC Demo Station #3
WCS software utility demonstration
Monotype Imaging
Integrated support for WCS profiles
Developed CMYK printer plugin with parameterized controls
…in five working days
Seiko Epson 2400 CMYK printer
Mitsubishi display demonstration
Automatic synchronization of associated profile with
display hardware
Change white point with display remote, profile is
automatically updated to match
Mitsubishi/NEDO very wide gamut, bright display prototype
XPS and WCS Demonstration
CMYK and n-channel support in IE
Application/Driver
Color Communication
Conversations to avoid “double
color management”
“What profile do you think best matches your
current state?”
“I’ve already done the color conversion with this
profile: Do no further color management (CM)”
“You do the CM using this destination profile”
“You do the CM using your idea of the best profile for
your current state”
“You apply your propriety color magic”
“I’ve created a color managed print DC, you do no
further CM”
In Summary
WSC supports existing color workflows
WCS provides continuing, enhanced ICC
support
WCS supports “high, wide, & deep” color
WCS implement state-of-the art color
science
WCS represents a commitment by
Microsoft to provide an extensible platform
for color innovation that will be viable for
years to come
Color Best Practices
Populate, persist, and promote accurate metadata
Associate and embed accurate color profiles
Use and preserve embedded profiles
If you change color space, update the metadata
If you don’t understand the metadata, preserve it
Have your installers associate profiles with your devices
If it’s not actually an sRGB device, it should have
associated profile(s)
Minimize number of color conversions in your workflows
Your driver should be aware of your device state and the
correct profile for that state
WCS provides choices – choose what makes sense for
your business
Opportunities And Advantages
Your ICC-based workflows continue to work and can
now take advantage of version 4 ICC profiles
The new WCS XML-based color profiles are
easily programmatically updated, enabling
self-characterizing devices
Third parties can add value via new plug-in device
models and gamut mapping models
Vendors can write DM and GMM plug-ins that communicate with
one another during processing
Support for high dynamic range, wide gamut, high
precision color data (HWD) in WCS enables integration of
such innovative devices into color managed workflows
Community
Email questions/feedback to
mscolor @microsoft.com
WCS “Color at Microsoft” blog at
http://blogs.msdn.com/color_blog
Questions
© 2006 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
Backup Slides
Extensibility Scenario Overview
MS Component
Win32 App
Win32
Monitoring
Application
WPF App
ISV Component
IHV Component
Win32 Print
APIs
WPF Print
APIs
Print Subsystem
XPS Doc
(Spool File)
Sample XPSDrv Print Driver
Conversion
Render Module
Filter Pipeline
Configuration
Module
Advanced
Color Filter
Configuration
Filter
Notification
Filter
XPS Doc
(PDL
Stream)
Printer
Scenario: Advanced Color
Windows Photo Gallery prints Windows Media Photo image
to XPSDrv print driver for 8-color inkjet photo printer
Scenario: Advanced Color
XPS Documents support high dynamic range,
wide gamut vector and image content
Using system services, filters can process rich
color data to best match printed output to user
intent and device capabilities
Windows Color System (WCS) – Enables extensive
color conversion
Windows Imaging Components (WIC) – Image format
support for Windows Media Photo and other XPS
image formats
PrintTicket – Supports an array of color processing
keywords to enable consistent and unambiguous color
control between app and device
Scenario: Advanced Color
Data Flow
Windows Photo Gallery allows user selection
of print settings
MXDW driver encapsulates Windows Media
Photo image and print settings (as PrintTicket)
in XPS Document
Filter process XPS file, decoding/transforming
image, saving image to JPG format
Advanced Color Filter
Print Subsystem
Filter Pipeline
Advanced Color Filter
XPS Doc
(Spool File)
Identify All
Images in
XPS File
Convert
Images
into Device
Color
Space
Convert
Images
into JPGs
Device Color
Profile
Windows Color
System
Windows
Imaging
Codecs
MS Component
ISV Component
IHV Component
Color Filter: Main Method
HRESULT CColorFilter::StartOperation(void)
{
HRESULT hr = SetupColorTransform(L“wsRGB.cdmp");
CComPtr<IUnknown> pUnk;
while (SUCCEEDED(hr = m_pProvider->GetXpsPart(&pUnk)))
{
CComPtr<IXpsDocument> pXD;
CComPtr<IFixedPage>
pFP;
if (SUCCEEDED(pUnk.QueryInterface(&pXD))) {
hr = m_pConsumer->SendXpsDocument(pXD);
}
else if ...
else if (SUCCEEDED(pUnk.QueryInterface(&pFP))) {
hr = ProcessFixedPage(pFP);
hr = m_pConsumer->SendFixedPage(pFP);
}
}
m_pConsumer->CloseSender();
m_pPrintPipeManager->FilterFinished();
DeleteColorTransform(m_hColorTrans);
return hr;
}
Color Filter: Setup Transformation
HPROFILE OpenColorProfile(const WCHAR * pszProfileName)
{
PROFILE profile = { PROFILE_FILENAME, (PVOID) pszProfileName,
(DWORD) (wcslen(pszProfileName) * sizeof(WCHAR)) };
return WcsOpenColorProfile(&profile, NULL, NULL, PROFILE_READ,
FILE_SHARE_READ, OPEN_EXISTING, 0);
}
HRESULT SetupColorTransform(const WCHAR * pszDestProfileName)
{
HRESULT hr = S_OK; HPROFILE hProfile[2];
hProfile[0] = OpenColorProfile(L"wscRGB.cdmp");
hProfile[1] = OpenColorProfile(pszDestProfileName);
DWORD intents = INTENT_ABSOLUTE_COLORIMETRIC;
m_hColorTrans = CreateMultiProfileTransform(hProfile, 2, &intents, 1,
WCS_ALWAYS | BEST_MODE, INDEX_DONT_CARE);
CloseColorProfile(hProfile[0]);
CloseColorProfile(hProfile[1]);
return hr;
}
Color Filter: Page Processing
HRESULT CColorFilter::ProcessFixedPage(IFixedPage* pFP)
{
HRESULT hr = S_OK;
CComPtr<IPrintWriteStream> pWriter;
if (SUCCEEDED(hr = pFP->GetWriteStream(&pWriter))) {
CComPtr<IPrintReadStream> pReader;
if (SUCCEEDED(hr = pFP->GetStream(&pReader))) {
CXmlFilter filter(pWriter, pReader); // XML filter
while (filter.GetToken())
if (wcscmp(filter.m_token, L"ImageSource") == 0) {
filter.GetToken(); // =
filter.GetToken(); // URI for ImageSource
ConvertImage(filter.m_token, filter.m_tokenlen,
COUNTOF(filter.m_token), pFP);
}
}
}
pWriter->Close();
}
return hr;
}
Color Filter: Transform Image
HRESULT ConvertWriteImage(pStream, imageUri, pFixedPage)
{
HRESULT hr = S_OK;
CComPtr<IUnknown>
pRead;
CComPtr<IPartImage>
pImagePart;
CComPtr<IPrintReadStream> pImageStream;
if (SUCCEEDED(hr = pFixedPage->GetPagePart(imageUri, &pRead)) &&
SUCCEEDED(hr = pRead.QueryInterface(&pImagePart)) &&
SUCCEEDED(hr = pImagePart->GetStream(&pImageStream))) {
CImage src; CImage dst;
CPrintStream2IStream readStream(pImageStream, NULL);
hr = src.Load(& readStream, m_pImagingFactory);
hr = dst.Create(src.m_Width,src.m_Height,BM_BGRTRIPLETS);
TranslateBitmapBits(m_hColorTrans, src.m_pBuffer, src.m_icmFormat,
src.m_Width,
src.m_Height, src.m_Stride, dst.m_pBuffer,
dst.m_icmFormat, dst.m_Stride, NULL, NULL);
CPrintStream2IStream writeStream(NULL, pStream);
hr = dst.Save(& writeStream, m_pImagingFactory);
}
return hr;
}
Central Color Control Panel
Central Color Control Panel
Central Color Control Panel