I am able to insert JPG image into a PDF document with DCTDecode
filter. I think the all parameters should be the same for PNG
image too, except the filter which should be FlateDecode
. However, when I try to insert PNG
with the same parameters, the PNG image is not visible in he PDF document.
UPDATE: I came to conclusion that the PDF file should include
1 0 obj <<
/Type /XObject
/Subtype /Image
/Width 512
/Height 512
/BitsPerComponent 8
/ColorSpace /DeviceRGB
/SMask 9 0 R
/Length 134753
/Filter /FlateDecode
>>
stream
PNG_RAW DATA
endstream
endobj
9 0 obj <<
/Type /XObject
/Subtype /Image
/Width 512
/Height 512
/BitsPerComponent 8
/ColorSpace /DeviceGray
/Length 12087
/Filter /FlateDecode
>>
stream
ALPHA_PIXELS
endstream
endobj
BUT how can I separate the PNG
raw data and the alpha pixels
via ImageMagick
? In other words, what ImageMagick
command can produce PDF_RAW_DATA
and ALPHA_PIXELS
for insertion into the pdf file.