3 Replies Latest reply: Apr 30, 2012 11:50 AM by lrosenth RSS

    Colors in PDF

    DDahlgren

      I am "experimenting" a little with colors in a PDF file.

      In the file I create two squares. The first square is colored using DeviceCMYK.

      The second square has the same color as the first one, but using DeviceRGB as the colorspace.

      When converting from CMYK to RGB I use the conversion formulas from section 10.3.5 in the PDF-specification.

      But the two squares have quite different colors. Can somebody explain whats going on?

       

      The Pdf is give below. In the file DeviceRGB

      R: 0.29

      G: 0.97

      B: 0.14    

       

      should be the same as DeviceCMYK 

      C: 0.68 

      M: 0   

      Y: 0.83  

      K: 0.03

       

      (The file:)

       

      %PDF-1.5

      1 0 obj

      <<

      /Length 330

      >>

      stream

      q

      1 0 0 1 57.47015494031 84.170688341377 cm

      1 0 0 1 0 0 cm

      1 0 0 1 0 0 cm

      1 0 0 1 0 0 cm

      1 0 0 1 -57.47015494031 -84.170688341377 cm

      /DeviceCMYK CS

      1 1 1 1 SCN

      /DeviceRGB  cs

      0.29 0.97 0.14  scn

      0.2743205486411 w

      2.743205486411 M

      0 J

      0 j

      40.873761747523 68.397256794514 33.192786385573 31.546863093726 re

      h

      B

      Q

      endstream

      endobj

      2 0 obj

      <<

      /Length 329

      >>

      stream

      q

      1 0 0 1 97.658115316231 68.260096520193 cm

      1 0 0 1 0 0 cm

      1 0 0 1 0 0 cm

      1 0 0 1 0 0 cm

      1 0 0 1 -97.658115316231 -68.260096520193 cm

      /DeviceCMYK CS

      1 1 1 1 SCN

      /DeviceCMYK cs

      0.68 0 0.83 0.03 scn

      0.2743205486411 w

      2.743205486411 M

      0 J

      0 j

      80.1016002032 56.327152654305 35.11303022606 23.865887731775 re

      h

      B

      Q

      endstream

      endobj

      3 0 obj

      <<

      /Type /Page

      /Parent 4 0 R

      /Resources <<

      /Font <<>>

      /XObject <<>>

      >>

      /MediaBox [0 0 255.11811023622 141.73228346457]

      /Contents [1 0 R 2 0 R]

      >>

      endobj

      4 0 obj

      <<

      /Type /Pages

      /Kids [3 0 R]

      /Count 1

      >>

      5 0 obj

      <<

      /Type /Catalog

      /Pages 4 0 R

      >>

      endobj

      xref

      0 6

      0000000000 65535 f

      0000000010 00000 n

      0000000397 00000 n

      0000000783 00000 n

      0000000956 00000 n

      0000001012 00000 n

      trailer

      <<

      /Size 6

      /Root 5 0 R

      >>

      startxref

      1067

      %%EOF

        • 1. Re: Colors in PDF
          lrosenth Adobe Employee

          I would recommend that you read up on Color Management and Color Science to get an understanding of why colors can/may look different.  Especially read up on “gamut”.

           

          Those formulas are only there for when you don’t have a proper ICC-based color management system in place.  They will NOT provide accurate conversions.

          • 2. Re: Colors in PDF
            DDahlgren Community Member

            I think I have a good understanding of color management, and I am very aware that different devices may have very different gamuts and may also give very different colors for the same input device colors.

             

            But, again, here I am talking about pure device colors, and thats why there should be no differnece in defining a color in (device) CMYK vs (device) RGB. In device space the colors are of course device dependent, but the same color should still come out the same on the same device (in this case, my screen).  The two are still exactly the same color, only "opposite" (subtractive vs. additive), and as long as we are in device space there is no device information (like ICC-profiles) involved. Its like defining weight in Pounds or Kilos; there is a direct conversion between the two.

             

            Thats why I wonder why the colors come out differenly in the PDF when I view it in a PDF-reader, like for example Acrobat.

            I was thinking that maybe a PDF reader assumes that a Device CMYK will be reproduced in print and "simulates" a print by using a standard CMYK outputprofile (like for example Euroscale Uncoated) while it assumes that a Device RGB will be reproduced on a screen and therefore uses a standard RGB outputprofile (like for example AdobeRGB or sRGB).

             

            Again, the thing is that pure colors in DEVICE space look different on the same device. Is it the PDF-reader that is "simultaing" paperprints for CMYK-colors? ...or is there something else here that I am missing??

             

             

            (EDIT:...the CMYK color is of course a lot less bright than the RGB in my PDF, and thats why I thought maybe the smaller gamut of a printer on matt paper is simulated, creating a lot more "dull" color...)

            • 3. Re: Colors in PDF
              lrosenth Adobe Employee

              As you point out, these are DEVICE DEPENDENT colorspaces, which means that the viewer can setup the device any way that it wants.  In the case of Adobe Acrobat/Reader, we use the "working spaces" defined by the user via ICC profiles to be those spaces.   If you want reliable color, don't use device colorants.  That's why all the PDF subset standards (PDF/X, PDF/A, PDF/E, etc.) all require the use of device independent colors.