views:

496

answers:

4

My goal is to convert a PDF into an image (specifically in TIFF).

There is a PDF property called BitsPerComponent

And According to description on the page,

This property can take the value 1, 2, 4, 8 or 16. Other values are not supported in the PDF Specification

Does that mean, 1, 2, 4, 8 or 16 translates to bits per pixel in images?

+2  A: 

Sounds more like bits per color component, where color component is one of either (Alpha)/Red/Green/Blue or Grey. So take the bits per component and multiply by the components per pixel to get bits per pixel. For example, if you're talking an RGB image you have 3 components. An RGB at 8 bit per component would be a 8 * 3 = 24bit per pixel image. If it was greyscale, e.g. one component, an 8 bit per component would be 8 bit per pixel.

Chris Hynes
I guess this is not a good indication to see if a PDF file is a gray-scale document or not...
Sung Meister
ColorSpaceType (http://www.abcupload.com/helppdf7net/source/6-abcpdf6.objects/colorspace/2-properties/colorspacetype.htm) might help you in determining that (though I have no clue of all that, just randomly poking around in those docs :))
Joey
+2  A: 

BitsPerPixel = 3 * BitsPerComponent if the color is stored as RGB

BitsPerPixel = 4 * BitsPerComponent if the color is stored as RGB with an alpha channel (ARGB)

RGB is a random assumption ... this will hold for every color model using 3 components and may be a alpha chanel. It will be BitsPerPixel = BitsPerComponent if it is a gray scale image.

Daniel Brückner
+1  A: 

No, it translates into bits per color channel. When you have a grayscale image this is essentially bits per pixel as well.

When you have an RGB image with 16 bits per channel you have a total of 48 bits per pixel (or even 64 if you have an alpha channel, too).

Joey
A: 

There are already lots of tools out there which can convert PDFs to images. If you want to write your own, you are going to have to learn a huge spec and build a rasterizer. Why do you need to build a custom solution?

@markee174: I am not creating my own PDF converter. I am using a 3rd party PDF library but I was not sure about the concept of BitsPerComponent and how it is related to BitsPerPixel for images.
Sung Meister