Split multi-page tiff with python -
what's best way split multi-page tiff python? pil doesn't seem have support multi-page images, , haven't found exact port libtiff python. pylibtiff way go? can provide simple example of how parse multiple pages within tiff?
i use imagemagick external program convert multi-page fax viewable pngs:
/usr/bin/convert /var/voip/fax/out/2012/04/fax_out_l1_17.tiff[0] -scale 50x100% -depth 16 /tmp/fax_images/fax_out_l1_17-0-m.png
does convert first page png
aaa.tiff[1] second page, , on.
or extract images, do:
convert -verbose fax_in_l1-1333564876.469.tiff a.png fax_in_l1-1333564876.469.tiff[0] tiff 1728x1078 1728x1078+0+0 1-bit bilevel directclass 109kib 0.030u 0:00.030 fax_in_l1-1333564876.469.tiff[1] tiff 1728x1078 1728x1078+0+0 1-bit bilevel directclass 109kib 0.020u 0:00.010 fax_in_l1-1333564876.469.tiff[2] tiff 1728x1078 1728x1078+0+0 1-bit bilevel directclass 109kib 0.020u 0:00.010 fax_in_l1-1333564876.469.tiff=>a-0.png[0] tiff 1728x1078 1728x1078+0+0 1-bit bilevel directclass 12kib 0.030u 0:00.019 fax_in_l1-1333564876.469.tiff=>a-1.png[1] tiff 1728x1078 1728x1078+0+0 1-bit bilevel directclass 8kib 0.040u 0:00.039 fax_in_l1-1333564876.469.tiff=>a-2.png[2] tiff 1728x1078 1728x1078+0+0 1-bit bilevel directclass 32kib 0.070u 0:00.070
so, split 1 multi-page tiff many-page tiff have execute:
convert in-12345.tiff /tmp/out-12345.tiff
and work temporary files: /tmp/out-12345-*.tiff
however imagemagick can lot of processing, can achieve desired result in 1 command.
Comments
Post a Comment