|Subject:||[Image-SIG] Does PIL support the sBIT chunk in PNG files?|
|Date:||Fri, 30 Nov 2007 09:51:35 -0700|
Thanks to everyone that is using and developing PIL - it has been most helpful!
I am working with a 16-bit greyscale PNGs created by LabVIEW (currently 14695 of them). They were captured on a 12-bit camera and encoded with the "sBIT" chunk, scaling the values up to 16-bit values as described in the PNG specs, section 12.5. Opening the images with PIL I get the full 16-bit values, but I need the original values. (The rescaling I need is described in the PNG specs, section 13.12.) The problem is additionally complicated by the fact that some of the darker images use only 10 or 11 of the available bits in the camera and LabVIEW also scales these to the full 16 bits available, so blindly dividing all images by a constant will not solve the problem.
As a workaround, I am opening each file and reading the "sBIT" byte directly and then using an integer division to restore the original camera values. This has solved my problem, but it would be better if I knew how to ask PIL to do the work for me.
PNG specification: http://www.w3.org/TR/PNG/
_______________________________________________ Image-SIG maillist - Image-SIG@xxxxxxxxxx http://mail.python.org/mailman/listinfo/image-sig
|<Prev in Thread]||Current Thread||[Next in Thread>|
|Previous by Date:||[Image-SIG] Importing image file as text, raghuram narasimhan|
|Next by Date:||[Image-SIG] image rendering in python, mobiledreamers|
|Previous by Thread:||[Image-SIG] Importing image file as text, raghuram narasimhan|
|Next by Thread:||[Image-SIG] image rendering in python, mobiledreamers|
|Indexes:||[Date] [Thread] [Top] [All Lists]|