Bits/sample must be 1 for Group 3/4 encoding/decoding error for b-w colourspace image on ccittfax4 compression #4492
-
I'm not sure whether i'm doing something wrong or it is a bug. I'm running vips
on third command i'm getting:
Which is unexpected for me because the input image is black & white. Any help? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello @eduardrudko, PDF images have transparency:
ie. you have an 8-bit GA (grey plus alpha) image. You need to drop the alpha with eg. flatten against white:
Then when saving you need to ask tiffsave to save the 8-bit image as 1-bit:
Other savers (eg. the JPEG saver) will flatten for you if you pass an image with alpha, but of course TIFF supports everything (except ccittfax4 compression with alpha!), so it doesn't do much automatic conversion for you. Perhaps selecting ccittfax4 compression should automatically convert to b-w, flatten, and set bitdepth to 1? Something for the todo list. |
Beta Was this translation helpful? Give feedback.
-
Hey @jcupitt, i haven't thought about alpha channel at all, thanks for help! It did work, however i had to change |
Beta Was this translation helpful? Give feedback.
Hello @eduardrudko,
PDF images have transparency:
ie. you have an 8-bit GA (grey plus alpha) image. You need to drop the alpha with eg. flatten against white:
Then when saving you need to ask tiffsave to save the 8-bit image as 1-bit:
Other savers (eg. the JPEG saver) will flatten for you if you pass an image with alpha, but of course TIFF supports everything (except ccittfax4 compression with alpha!), so it doesn't do much automatic conversion for you.
Perhaps selecting ccittfax4 compre…