Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - 16 bit Smask?
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

16 bit Smask?

 Post Reply Post Reply
Author
jice View Drop Down
New Member
New Member
Avatar

Joined: 19 Oct 2011
Points: 3
Post Options Post Options   Quote jice Quote  Post ReplyReply Direct Link To This Post Topic: 16 bit Smask?
    Posted: 19 Oct 2011 at 4:09pm
Hi

I'm creating a pdf with an image and an alpha transparency layer (/Smask). I've done this correctly with a 8-bit gray scale image (good result), but trying to do the same with a 16-bit gray scale image does not work (gives a strange visual result under acrobat reader).

Is such a soft mask supported by the pdf specification, or only 8-bit masks are authorized?

The following - with a 8-bit soft mask - gives a good visual result:

6 0 obj
<<
/Type /XObject
/Subtype /Image
/Name /Immypngalpha
/Width 128
/Height 128
/BitsPerComponent 8
/ColorSpace /DeviceRGB
/Smask 7 0 R
/Filter /FlateDecode
/DecodeParms <</Predictor 15 /Colors 3 /BitsPerComponent 8 /Columns 128>>
/Length 2622
>>
stream
...
endstream
endobj
7 0 obj
<<
/Type /XObject
/Subtype /Image
/Name /Immypngalpha-mask
/Width 128
/Height 128
/BitsPerComponent 8
/ColorSpace /DeviceGray
/Filter /FlateDecode
/DecodeParms <</Predictor 15 /Colors 1 /BitsPerComponent 8 /Columns 128>>
/Length 4013
>>
stream
...
endstream
endobj

Whereas the following - with a 16-bits soft mask - gives a bad visual result in acrobat:

6 0 obj
<<
/Type /XObject
/Subtype /Image
/Name /Immypngalpha
/Width 256
/Height 256
/BitsPerComponent 16
/ColorSpace /DeviceRGB
/Smask 7 0 R
/Filter /FlateDecode
/DecodeParms <</Predictor 15 /Colors 3 /BitsPerComponent 16 /Columns 256>>
/Length 150531
>>
stream
...
endstream
endobj
7 0 obj
<<
/Type /XObject
/Subtype /Image
/Name /Immypngalpha-mask
/Width 256
/Height 256
/BitsPerComponent 16
/ColorSpace /DeviceGray
/Filter /FlateDecode
/DecodeParms <</Predictor 15 /Colors 1 /BitsPerComponent 16 /Columns 256>>
/Length 19658
>>
stream
...
endstream
endobj

Thanks in advance!
Back to Top
aandi View Drop Down
Senior Member
Senior Member


Joined: 07 Jul 2011
Points: 18358
Post Options Post Options   Quote aandi Quote  Post ReplyReply Direct Link To This Post Posted: 19 Oct 2011 at 4:43pm
It would be interesting to try it out if you have a sample with 16 bit SMask that you can post?
Back to Top
jice View Drop Down
New Member
New Member
Avatar

Joined: 19 Oct 2011
Points: 3
Post Options Post Options   Quote jice Quote  Post ReplyReply Direct Link To This Post Posted: 20 Oct 2011 at 9:47am
Hi
You can find the 8 and 16-bits files at:
http://jice.free.fr/pdfinclude/samples/images-8.pdf -> 8 bits, correct
http://jice.free.fr/pdfinclude/samples/images-16.pdf -> 16 bits, incorrect
I've also displayed the masks so that you can see that it seems correct.
TIA
Back to Top
aandi View Drop Down
Senior Member
Senior Member


Joined: 07 Jul 2011
Points: 18358
Post Options Post Options   Quote aandi Quote  Post ReplyReply Direct Link To This Post Posted: 20 Oct 2011 at 10:14am
Thanks for posting the files. This seems to be a case of software limitations ("bugs" to be less generous).
 
Results:
Acrobat 7, Acrobat 9: show the image with some sort of overlay of stripes.
Acrobat X: show the image correctly
I suspect Reader X would follow the same pattern.
 
Other software tried:
Mac OS X Preview: image is good. The version of Preview is not important, since PDF rendering is built into Mac OS. The version of Mac OS X is 10.5.8 for this test.
 
Google Docs display: does not display image with 16 bit SMask. Plain 16 bit image is a black box.
 
Now the hard part for you. It's always very difficult to decide whether to make PDF files which you know to be valid, but which are rejected due to bugs in other software...
Back to Top
aandi View Drop Down
Senior Member
Senior Member


Joined: 07 Jul 2011
Points: 18358
Post Options Post Options   Quote aandi Quote  Post ReplyReply Direct Link To This Post Posted: 20 Oct 2011 at 10:40am
Supplement: I was curious about Acrobat 6. PDF 1.5 (Acrobat 6) was the first version to support 16 bit images at all.
 
Acrobat 5 - reject with error (correctly, not a bug).
Acrobat 6 - 16 bit masked image faulty like 7.0 and 9.0; 16 bit image shown correctly.
Back to Top
jice View Drop Down
New Member
New Member
Avatar

Joined: 19 Oct 2011
Points: 3
Post Options Post Options   Quote jice Quote  Post ReplyReply Direct Link To This Post Posted: 20 Oct 2011 at 12:43pm
Someone please kill me!
You're completely right, also tested with foxit reader, and the result is perfect for both.
well I guess that if Adobe X shows it correctly then I'm done, and I'll add some caveat emptor to the README...
Thanks a lot!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.031 seconds.