g3 doesn't work

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ynguyen
Posts: 12
Joined: 2012-04-11T10:10:29-07:00
Authentication code: 8675308

g3 doesn't work

Post by ynguyen »

When I run the following command and syntax to convert a tiff file into g3 format it will produce two final tiff file.
How can I force convert with g3 to produce one tiff file?


convert text-file.tiff g3:new.tiff

new-0.tiff
new-1.tiff

Version==>ImageMagick 6.5.4-7 2010-02-26 Q16


Purpose:
Trying to convert a text file into a tiff file with g3 and 8 bit format so I can use for faxing.


Any help will be appreciate it.

Thank you
ynguyen
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: g3 doesn't work

Post by fmw42 »

post a link to your input tiff file so others can test with it.
ynguyen
Posts: 12
Joined: 2012-04-11T10:10:29-07:00
Authentication code: 8675308

Re: g3 doesn't work

Post by ynguyen »

This is what I have done to convert a text file and produce the g3 image:

1.
cat text-file | convert -font Courier-Bold -density 200 text:- -depth 8 text-file.tiff


2.
convert text-file.tiff g3:new.tiff

The convert will produce two final file
new-0.tiff
new-1.tiff





-bash-4.1# more text-file

*************************** contain of a text-file file ***********************************************************
09:02:04 1699339

03/23/12 PAGE 1 of 1





ID : 05185

xxxxxLECTRIC COMPANY Camplbell XXXXXXXXXXXXXXXXXXXXX, INC.

6000 GREENWOOD AVE 26010 Login fine DR.
NE, NE 49202- WAYM HEIGHTS, NE 49971
ATTN: SALES


P/O NO. BUY TERMS SHIP VIA FOB TELEPHONE NO. FAX NO.
xxxxxxx MJG N30 UPS UPS - GROUND DEST 343-334-3434 555-835-0335




ISSUED ORDER TOTAL FREIGHT MISC. GRAND TOTAL
10/05/11 xxx xxxx xxx xxxx

IT QTY ITEM DATE
NO ORDERED UNIT ITEM NO. / DESCRIPTION NEEDED PRICE EXTENDED

1 2 EA ddddC01-CHGP 10/04/10 7.05 14.10
Circuit Breaker, 1-P, 1A/480V, C,
480Y/277VAC, UL1077 Recognized,
10KAIC@480V, DIN Mount

************************************************************
This is atest
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
************************************************************
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
************************************************************
PURCHASE ORDER TOTAL 14.10

**********************************************************************************************************************************************************


Thank you,
ynguyen
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: g3 doesn't work

Post by fmw42 »

This may be a better way to generate your original tiff.

convert testfile.txt -font Courier-Bold -density 200 -depth 8 testfile.tiff

However, either way I create the tiff file, when I do


convert testfile.tiff G3:test-file_new.tiff

identify test-file_new.tiff
identify: Not a TIFF or MDI file, bad magic number 5120 (0x1400). `test-file_new.tiff' @ error/tiff.c/TIFFErrors/508.


I do not get two resulting images. And the file does not open.

I am not sure - does IM support G3: ??? I do not see it mentioned at http://www.imagemagick.org/Usage/formats/#tiff or at http://www.imagemagick.org/script/formats.php#supported However, I will defer to the IM developers for their comments.


I am on IM 6.7.6.5 Q16 Mac OSX Snow Leopard.
ynguyen
Posts: 12
Joined: 2012-04-11T10:10:29-07:00
Authentication code: 8675308

Re: g3 doesn't work

Post by ynguyen »

If you do little g3 (not the big G) it will generate two file. Perhaps, it only do this on Linux OS.

However, when I did this (it showed similar error as you had seing).
-bash-4.1# identify testfileNew-0.tiff
identify: Not a TIFF or MDI file, bad magic number 5120 (0x1400). `testfileNew-0.tiff' @ tiff.c/TIFFErrors/336.
-bash-4.1# identify testfileNew-1.tiff
identify: Not a TIFF or MDI file, bad magic number 5120 (0x1400). `testfileNew-1.tiff' @ tiff.c/TIFFErrors/336.

How to get g3 to convert properly ? so it will produce a reconizge tiff format.

The question is how to convert a text file or an image into a tiff format with a bilevel image, 8 bit, g3 format?
So, it can be send via fax


bilevel image (bits/sample 8)

ynguyen
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: g3 doesn't work

Post by fmw42 »

I don't know about the G3 part, but

convert image.tiff -depth 8 -type bilevel newimage.tiff

should convert it to bilevel. Try that and see if it can be faxed. see http://www.imagemagick.org/script/comma ... s.php#type

or

convert image.tiff -depth 8 -threshold XX% newimage.tiff

where you pick the XX% that gives you the best black/white results without too much extra black and without losing some of the text.

see http://www.imagemagick.org/Usage/quantize/#threshold
ynguyen
Posts: 12
Joined: 2012-04-11T10:10:29-07:00
Authentication code: 8675308

Re: g3 doesn't work

Post by ynguyen »

fmw42

Thank you very much for all the help, much appreciate it.

I have tried these option and able to sent to the fax.

composite -geometry +150-180 -compose bumpmap ytext.tif po_orig.tiff -depth 1 -compress Fax fax.tif

ynguyen
Post Reply