Skip to content

Bits/sample must be 1 for Group 3/4 encoding/decoding error for b-w colourspace image on ccittfax4 compression #4492

Answered by jcupitt
eduardrudko asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @eduardrudko,

PDF images have transparency:

$ vips colourspace thesis.pdf x.v b-w
$ vipsheader x.v
x.v: 595x842 uchar, 2 bands, b-w, pdfload

ie. you have an 8-bit GA (grey plus alpha) image. You need to drop the alpha with eg. flatten against white:

$ vips flatten x.v x2.v --background 255

Then when saving you need to ask tiffsave to save the 8-bit image as 1-bit:

$ vips tiffsave x2.v x.tif --bitdepth 1 --compression ccittfax4

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…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by eduardrudko
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4491 on April 30, 2025 15:44.

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy