[vtkusers] vtkPNGWriter() Png 10 bit

Chuck Atkins chuck.atkins at kitware.com
Mon Dec 7 09:51:37 EST 2015


Hi Pedro,

The vtkPNGWriter supports either 8-bit or 16-bit integral components with
1, 2, 3, or 4 channels (gray, gray+alpha, rgb, and rgb+alpha). If your
vtkImageData uses unsigned short as it's scalar type then the full range
should get saved, so it won't be 10-bit but it will be 16-bit and you'll
still get all your pixels data correct.  That being said, both the PNG spec
and libpng only allow for bitdepths of 1, 2, 4, 8, and 16, so a 16-bit PNG
is the best you'll probably get.  I wouldn't worry about the "wasted space"
from the extra bits as compression should drop that to effectively
nothing.  The consuming application would just need to be aware of the
reduced sample range, i.e. [0:1023] instead of [0:65535].


- Chuck

On Thu, Dec 3, 2015 at 4:52 PM, Pedro Paulo <pedropaulobmjr at hotmail.com>
wrote:

> Hi, is there an way to save a png 10 bit file through vtk
> using vtkPNGWriter() or other way?
> Thanks.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151207/ec79bda8/attachment.html>


More information about the vtkusers mailing list