Skip navigation
Currently Being Moderated

Colors in PDF

Apr 30, 2012 7:56 AM

Tags: #color

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

 
Replies
  • Currently Being Moderated
    Apr 30, 2012 9:21 AM   in reply to DDahlgren

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 30, 2012 11:50 AM   in reply to DDahlgren

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points