6 Replies Latest reply: Jul 21, 2014 3:59 PM by mattivore RSS

    Problem in displaying image contained in a pdf file

    rha906 Community Member

      I am reading a PDF file that contains an image, color space used in image is CMYK,  when I read the image and output it into my own viewer (not pdf reader) I have to subtract each component of each pixel from 255 then I get normal display otherwise I get negative image of the input image. Please tell me why I have to subtract the whole image data from 255?

       

      Best Regards,

      Ali

        • 1. Re: Problem in displaying image contained in a pdf file
          lrosenth Adobe Employee

          As we don't know your code, your imaging library or anything else that you are doing - and my crystal ball is on the fritz - we can't really help :(.

           

          However, given that you are talking about CMYK the first question is about whether you a re working on a CMYK surface or converting to RGB?  If converting, how?

           

          Second, what filter is applied to the image?  DCT? Flate?  Other?

           

          Third, are you considering any DecodeParms on the image?

           

          Fourth, is the image indexed or not?

           

          And the list goes on..

          • 2. Re: Problem in displaying image contained in a pdf file
            rha906 Community Member

            Following are the answers of your questions in sequence:

             

            1.     I am reworking on CMYK surface, is there any useful way to convert CMYK to RGB, I tried several formulas but couldn't do it.

            2.     Flate filter is applied on it.

            3.     Predictor 15 is the entry used from DecodeParams

            4.     I dont know whether the image is indexed or not, how can it be known??

             

            Please suggest whats the issue.

             

             

            Regards,

            Ali

            • 3. Re: Problem in displaying image contained in a pdf file
              lrosenth Adobe Employee

              The proper way to convert CMYK->RGB is to use an ICC-based color transformation via a CMM (color management module), however a single algorithmic version is provided in the PDF standard (ISO 32000-1:2008).

               

              Seems like you need to read over the standard some more if you don't know how to tell if an image is indexed.

               

              Beyond that - we'd need to see the image/PDF...

              • 4. Re: Problem in displaying image contained in a pdf file
                rha906 Community Member

                But my question is that, given the above information, can you please tell me why I need to subtract the whole image (each component of every pixel) from 255 while remaining in the CMYK color space, also there is no Decode entry in the image dictionary.

                 

                 

                Regards

                • 5. Re: Problem in displaying image contained in a pdf file
                  lrosenth Adobe Employee

                  No, I can't, because I don't know how your code operates :(.   I don't know how your canvas code works. I also don't know anything more about the image in question.

                   

                  If you want to post the PDF in question, since it sounds like a single PDF that is causing an issue, we can investigate it.

                  • 6. Re: Problem in displaying image contained in a pdf file
                    mattivore

                    There's not enough information here to give a definitive answer. However, you may want to see if the ColorTransform key is defined with a value of 1 for the image, for those images that are coming out reversed. I believe I've run into this before with handing CMYK-encoded DCT streams that were really stored as YUVK format.