Skip to contentSkip to conversation

pwgtoraster vs calibrated spaces

Printing-architecture James Cloos 4 participants 12 messages May 31, 2014 – Jun 5, 2014

lore
Share & tools
lore
#0 lore raw

I was wrong about sGray. It turns out that sGray is not defined as having the same curve as sRGB, but rather it always has gamma 2.2.

The cupsraster document says srgb gamma/whitepoint, and the pwg raster doc says srgb grayscale. But everything else I've found says 2.2. And it seems a D50 illuminate.

That being said, this colorspace dictionary:

[ /CalGray
<< /WhitePoint [ 0.96420288 1.0 0.82490540 ]

      /Gamma 2.2 
Quoted 1 line
Quoted 1 line

]

in stead of /DeviceGray should work for converting sGray pages to pdf.

For AdobeRGB, you can use this:

[ /CalRGB
<< /WhitePoint [ 0.95045471 1.0 1.08905029 ]

     /Gamma [ 2.2 2.2 2.2 ]
Quoted 1 line
Quoted 1 line

endobj

For sRGB, though, you'll have to embed the icc file.

AFAICT, put the space in an object and specify a ref to that object where you currently specify /DeviceRGB, usw.

-JimC
--
James Cloos <[email protected]> OpenPGP: 0x997A9F17ED7DAEA6

#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"JC" == James Cloos <[email protected]> writes:

JC> [ /CalGray
JC> << /WhitePoint [ 0.96420288 1.0 0.82490540 ]
JC> /Gamma 2.2
JC> >>
JC> ]

JC> [ /CalRGB
JC> << /WhitePoint [ 0.95045471 1.0 1.08905029 ]
JC> /Gamma [ 2.2 2.2 2.2 ]
JC> >>
JC> ]

I forgot the matrix in that last one. Add:

        /Matrix [ 0.60974121 0.31111145 0.01947021 0.20527649 0.62567139 0.06086731 0.14918518 0.06321716 0.74456785 ]

to that /CalRGB.

-JimC
--
James Cloos <[email protected]> OpenPGP: 0x997A9F17ED7DAEA6

#2 lore raw

James,

What standard defines sGray? Because all of the informal definitions online and the one we (Apple) went with some 12 years ago says that sGray uses the sRGB transfer function (gamma). Anything else would be simply confusing.

(of course gamma 2.2 is so close to sRGB's transfer function that it doesn't really matter, but I'm really interested in knowing why you think the CUPS definition of sGray is wrong...)

Quoted 20 lines · James Cloos
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"JC" == James Cloos <[email protected]> writes:

JC> [ /CalGray
JC> << /WhitePoint [ 0.96420288 1.0 0.82490540 ]
JC> /Gamma 2.2
JC> >>
JC> ]

JC> [ /CalRGB
JC> << /WhitePoint [ 0.95045471 1.0 1.08905029 ]
JC> /Gamma [ 2.2 2.2 2.2 ]
JC> >>
JC> ]

I forgot the matrix in that last one. Add:

       /Matrix [ 0.60974121 0.31111145 0.01947021 0.20527649 0.62567139 0.06086731 0.14918518 0.06321716 0.74456785 ]

to that /CalRGB.

Quoted 7 lines

-JimC
--
James Cloos <[email protected]> OpenPGP: 0x997A9F17ED7DAEA6
_______________________________________________
Printing-architecture mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/printing-architecture

_________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair

#3 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"MS" == Michael Sweet <[email protected]> writes:

MS> What standard defines sGray?

Every search I did returned gs's sgray (which is a simple 2.2 with the whitepoint I mentioned) and references to multi-ink black-and-white photograph printing which all said 2.2. I do not recall mention of the whitepoint for most of the latter, but one implied Lab(1.0,0.0,0.0). (or Lab(100.0,0.0,0.0) if one prefers [0 100 -127 127 -127 127].)

I didn't see *any* search results referencing srgb's transfer function except the cupsraster document. The pwg raster document didn't show up in the search.

I found no evidence, when I searched, that Apple prefers otherwise. And some of the photographers mentioned using osx.

-JimC
--
James Cloos <[email protected]> OpenPGP: 0x997A9F17ED7DAEA6

#4 lore raw

James,

A simple search of "sgray color space" yields a page of links that all mention sGray as a version of sRGB. And while I respect the work that the Ghostscript developers do, their support for sGray came long after it was already in gdevcups and the rest of the raster filters used by CUPS. I would suggest filing a bug with the Ghostscript developers...

Quoted 14 lines · James Cloos
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"MS" == Michael Sweet <[email protected]> writes:

MS> What standard defines sGray?

Every search I did returned gs's sgray (which is a simple 2.2 with the whitepoint I mentioned) and references to multi-ink black-and-white photograph printing which all said 2.2. I do not recall mention of the whitepoint for most of the latter, but one implied Lab(1.0,0.0,0.0). (or Lab(100.0,0.0,0.0) if one prefers [0 100 -127 127 -127 127].)

I didn't see *any* search results referencing srgb's transfer function except the cupsraster document. The pwg raster document didn't show up in the search.

Quoted 6 lines

I found no evidence, when I searched, that Apple prefers otherwise. And some of the photographers mentioned using osx.

-JimC
--
James Cloos <[email protected]> OpenPGP: 0x997A9F17ED7DAEA6

_________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair

#5 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"MS" == Michael Sweet <[email protected]> writes:

MS> A simple search of "sgray color space" yields a page of links that all MS> mention sGray as a version of sRGB.

I didn't see anything like that. But I tried sgray colorspace, sgray icc and sgray.icc.

Even with the space in color space, I'm not finding the page you mention.

I did just find a github project with an sGray.icc which is © Adobe and uses a chad and a 1024-entry curve. The icc seems to be part of Sun's com/sun/pdfview java.

There is a page which says photoshop has a (hard to access) sgray icc, but doesn't characterize it at all.

Most of the hits still reference gs.

Goog can tell I'm coming from a linux box; perhaps that colours ☺ the results I get vs the results you get?

-JimC
--
James Cloos <[email protected]> OpenPGP: 0x997A9F17ED7DAEA6

#6 lore raw

This is an attempt at an sGray icc Based on Argyll's sRGB.

Corrections or verifications welcome.

If valid, or once fixed, rastertopdf should embed it when dealing with sGray pages.

-JimC
--
James Cloos <[email protected]> OpenPGP: 0x997A9F17ED7DAEA6

#7 lore raw
Quoted 8 lines · James Cloos

This is an attempt at an sGray icc Based on Argyll's sRGB.

Corrections or verifications welcome.

If valid, or once fixed, rastertopdf should embed it when dealing with sGray pages.

<sGray.icc><sGray.xml>

Although only Y should matter, there is a difference in the X and Z values in the lumi tag.

Chris Murphy

#8 lore raw
In reply to James Cloos

Am 03.06.2014 02:44, schrieb James Cloos:

Quoted 10 lines

This is an attempt at an sGray icc Based on Argyll's sRGB.

Corrections or verifications welcome.

If valid, or once fixed, rastertopdf should embed it when dealing with sGray pages.

Color space is not standard.
Data Color Space should be GRAY.

$ iccDumpProfile -v /tmp/sGray.icc
Profile:          '/tmp/sGray.icc'
Profile ID:       Profile ID not calculated.
Size:             2596(0xa24) bytes

Header
------

Attributes:       Reflective | Glossy
Cmm:              Little CMS
Creation Date:    6/2/2014  23:47:17
Creator:          'lcms' = 6C636D73
Data Color Space: Unknown 'sGra' = 73477261
Flags             EmbeddedProfileFalse | UseAnywhere
PCS Color Space:  XYZData
Platform:         Macintosh
Rendering Intent: Perceptual
Type:             DisplayClass
Version:          3.40
Illuminant:       X=0.9642, Y=1.0000, Z=0.8249

Profile Tags
------------

                      Tag    ID      Offset         Size
                     ----  ------    ------         ----
    profileDescriptionTag  'desc'       240           95
             copyrightTag  'cprt'       336           53
            technologyTag  'tech'       392           12
     viewingConditionsTag  'view'       404           36
             luminanceTag  'lumi'       440           20
           measurementTag  'meas'       460           36
       mediaWhitePointTag  'wtpt'       496           20
       mediaBlackPointTag  'bkpt'       516           20
               grayTRCTag  'kTRC'       536         2060

Validation Report
-----------------
Profile has Critical Error(s) that violate ICC specificaiton.

Error! - - Unknown 'sGra' = 73477261: Unknown color space! Error! - Critical tag(s) missing.

kind regards
Kai-Uwe

#9 lore raw
Quoted 12 lines · Kai-Uwe Behrmann

Am 03.06.2014 02:44, schrieb James Cloos:

Quoted 10 lines

This is an attempt at an sGray icc Based on Argyll's sRGB.

Corrections or verifications welcome.

If valid, or once fixed, rastertopdf should embed it when dealing with sGray pages.

Quoted 2 lines

Color space is not standard.
Data Color Space should be GRAY.

Yes definitely good catch. That field also seems to have single quotes in it.

Chris Murphy

#10 lore raw
In reply to Kai-Uwe Behrmann
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"KB" == Kai-Uwe Behrmann <[email protected]> writes:

KB> Data Color Space: Unknown 'sGra' = 73477261

So Data Color Space is a 32bit int, then?

Fixed.

As I wrote, I based this on the xml conversion of the sRGB shipped with Argyll.

Are the viewingConditionsType and measurementType sections of value?

That seems to be where some of the issues are.

-JimC
--
James Cloos <[email protected]> OpenPGP: 0x997A9F17ED7DAEA6

#11 lore raw

Am 05.06.2014 11:23, schrieb James Cloos:

Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"KB" == Kai-Uwe Behrmann <[email protected]> writes:

KB> Data Color Space: Unknown 'sGra' = 73477261

So Data Color Space is a 32bit int, then?

Yes, big endian.
http://www.color.org/ICC_Minor_Revision_for_Web.pdf
6.1.5 Color Space signature
grayData
'GRAY'
47524159h
uInt32Number

Quoted 7 lines

Fixed.

As I wrote, I based this on the xml conversion of the sRGB shipped with Argyll.

Are the viewingConditionsType and measurementType sections of value?

Not many software uses these tags. Can not test. Otherwiese they should be fine in plain copying.

kind regards
Kai-Uwe