Converting color TIFF to CCITT G4 compression

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, xnview

Post Reply
sergiokapone
Posts: 6
Joined: Sat Feb 02, 2019 6:24 pm

Converting color TIFF to CCITT G4 compression

Post by sergiokapone » Sat Feb 02, 2019 6:29 pm

Help me, please. I have an color (LZW, or else) tiff, how can I simple compress it into CCITT group 4?

cday
XnThusiast
Posts: 2134
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Converting color TIFF to CCITT G4 compression

Post by cday » Sat Feb 02, 2019 6:53 pm

sergiokapone wrote:
Sat Feb 02, 2019 6:29 pm
I have an color (LZW, or else) tiff, how can I simple compress it into CCITT group 4?
CCITT G4 compression is only applicable to 1-bit (black and white) images, so you wish to convert a color TIFF to black and white and save it with CCITT G4 compression?

sergiokapone
Posts: 6
Joined: Sat Feb 02, 2019 6:24 pm

Re: Converting color TIFF to CCITT G4 compression

Post by sergiokapone » Sun Feb 03, 2019 9:04 am

cday wrote:
Sat Feb 02, 2019 6:53 pm
CCITT G4 compression is only applicable to 1-bit (black and white) images, so you wish to convert a color TIFF to black and white and save it with CCITT G4 compression?
Yes, I want to convert a color TIFF to black and white and save it with CCITT G4 compression.

cday
XnThusiast
Posts: 2134
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Converting color TIFF to CCITT G4 compression

Post by cday » Sun Feb 03, 2019 9:22 am

The conversion to black and white can be performed using the following option:

Code: Select all

-binary dither    : Convert in Binary
              pattern : Ordered pattern
              floyd   : Floyd steinberg
              halft45 : Halftone 45
              halft90 : Halftone 90
              nodither : No dithering
So, for example, to convert without using any of the above dither options use:

Code: Select all

-binary nodither

The compression options for saving to the TIFF format are:

Code: Select all

-c value          : Compression number
              default : 0 (uncompressed)
              TIFF   : 1 (Rle), 2 (LZW), 3 (LZW+Prediction)
                       4 (ZLIB)
                       5 (CCITT G3), 6 (CCITT G3-2D), 7 (CCITT G4) only B/W
                       8 (JPEG) only 24/32 bits
So to output to TIFF format with CCITT G4 compression use:

Code: Select all

-out TIFF 7
Do you have the NConvert Help file listing?

Note:

I am away from home and using my Linux laptop, so I can't test code as I normally would without booting into Windows 10 which I would really rather avoid... :wink:

sergiokapone
Posts: 6
Joined: Sat Feb 02, 2019 6:24 pm

Re: Converting color TIFF to CCITT G4 compression

Post by sergiokapone » Sun Feb 03, 2019 1:14 pm

cday, thank you. This is that what I neen.

Post Reply