PDF to Tif coming through FAX inverted.

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
WeBoat

PDF to Tif coming through FAX inverted.

Post by WeBoat »

We are testing the latest imageMagick on windows. We are generating fax TIF files from incoming PDF's using the following command line:

convert.exe -density 204x196 -resize 1728x -compress Fax in.pdf out.tif (we have tried with -monochrome as well)

The fax system is based on callweaver and has worked very well with both coolutils and activePDF.

With imageMagick, the TIF generated by the incoming fax server is completely inverted. Black background white text. Under windows, the outgoing TIF looks fine. It's just when it goes through the fax system that it comes back inverted.

Any ideas? Help?

Much thanks

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

Re: PDF to Tif coming through FAX inverted.

Post by fmw42 »

don't know much about this, but look at

http://www.imagemagick.org/Usage/formats/#pdf

http://www.imagemagick.org/Usage/formats/#tiff

-define quantum:polarity=min-is-black
-define quantum:polarity=min-is-white
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: PDF to Tif coming through FAX inverted.

Post by magick »

Can you post a URL to your PDF so we can try to reproduce the problem?

Have you tried to convert with the latest ImageMagick release, 6.5.4-1? We just tested and the TIFF fax images are not inverted.
WeBoat

Re: PDF to Tif coming through FAX inverted.

Post by WeBoat »

magick wrote:Can you post a URL to your PDF so we can try to reproduce the problem?

Have you tried to convert with the latest ImageMagick release, 6.5.4-1? We just tested and the TIFF fax images are not inverted.

I just downloaded it yesterday, so I hope it's current.

The images are not inverted until they go through callweaver and are actually faxed. When they are received the new tif is inverted. We are testing about 6 PDF -> TIF converters and imagemagick is the only one this happens with.

I'll try to post an example somewhere.

Thanks
WeBoat

Re: PDF to Tif coming through FAX inverted.

Post by WeBoat »

Original PDF

http://67.225.179.49/temp/testdoc.pdf

Converted with imagemagick parameters above:

http://67.225.179.49/temp/testdoc.tif

Then faxed through callweaver, this is the incoming tif

http://67.225.179.49/temp/testdoc-faxed.tif

and converted back to PDF

http://67.225.179.49/temp/testdoc-faxed.pdf
WeBoat

Re: PDF to Tif coming through FAX inverted.

Post by WeBoat »

I found one other example of this happening to someone else with callweaver.

It was opened as a possible bug for callweaver, but it was closed with the answer "When I sent a proper Tif, the issue went away" and a resolution of "Not our bug"

I've no idea what they meant by a "proper tif".

Thanks again.
WeBoat

Re: PDF to Tif coming through FAX inverted.

Post by WeBoat »

Bump .... any ideas? We are about to put imagemagick in the "doesn't work" category.

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

Re: PDF to Tif coming through FAX inverted.

Post by fmw42 »

WeBoat wrote:Original PDF

http://67.225.179.49/temp/testdoc.pdf

Converted with imagemagick parameters above:

http://67.225.179.49/temp/testdoc.tif

Then faxed through callweaver, this is the incoming tif

http://67.225.179.49/temp/testdoc-faxed.tif

and converted back to PDF

http://67.225.179.49/temp/testdoc-faxed.pdf
Cannot get to any of these files!!!!!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF to Tif coming through FAX inverted.

Post by fmw42 »

WeBoat wrote:I found one other example of this happening to someone else with callweaver.

It was opened as a possible bug for callweaver, but it was closed with the answer "When I sent a proper Tif, the issue went away" and a resolution of "Not our bug"

I've no idea what they meant by a "proper tif".

Thanks again.

Sounds like a callweaver issue and not IM.
WeBoat

Re: PDF to Tif coming through FAX inverted.

Post by WeBoat »

Callweaver says it's imagemagick of course.

What makes me tend to believe that is we have tested 5 other conversion utilities with callweaver and imagemagick is the ONLY one this happens with. I posted the test images, but I've guess no one took a look at them.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF to Tif coming through FAX inverted.

Post by fmw42 »

I repeat, your images cannot be downloaded --- Error cant get to server
WeBoat

Re: PDF to Tif coming through FAX inverted.

Post by WeBoat »

fmw42 wrote:I repeat, your images cannot be downloaded --- Error cant get to server
My error... Firewall issue for that IP.... Try these.

Original PDF

http://www.fusedware.com/temp/testdoc.pdf

Converted with imagemagick parameters above:

http://www.fusedware.com/temp/testdoc.tif

Then faxed through callweaver, this is the incoming tif

http://www.fusedware.com/temp/testdoc-faxed.tif

and converted back to PDF

http://www.fusedware.com/temp/testdoc-faxed.pdf

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

Re: PDF to Tif coming through FAX inverted.

Post by fmw42 »

Take a look at your verbose information from identify, you will see lots of differences. Changes in class (pseudoclass vs truecolor), and perhaps most significant changes in Endianess (MSB vs LSB). For a 1-bit (b/w) image, I suspect if your Endianess is switched, then you will get a b/w inversion. So your callweaver software is changing endianess on you as further indicated by the histogram swap of white and black, but the ratio of black vs white pixels is also altered even when the inversion is considered. So it is doing something else as well.

identify -verbose testdoc.tif
Image: testdoc.tif
Format: TIFF (Tagged Image File Format)
Class: PseudoClass
Geometry: 1728x2149+0+0
Resolution: 204x196
Print size: 8.47059x10.9643
Units: Undefined
Type: Bilevel
Base type: Bilevel
Endianess: MSB
Colorspace: RGB
Depth: 1-bit
Channel depth:
gray: 1-bit
Channel statistics:
gray:
min: 0 (0)
max: 1 (1)
mean: 0.947759 (0.947759)
standard deviation: 0.222513 (0.222513)
kurtosis: 14.1971
skewness: -4.02457
Histogram:
193996: ( 0, 0, 0) #000000 black
3519476: (255,255,255) #FFFFFF white

Colormap: 2
0: (255,255,255) #FFFFFF white
1: ( 0, 0, 0) #000000 black

identify -verbose testdoc-faxed.tif
Image: testdoc-faxed.tif
Format: TIFF (Tagged Image File Format)
Class: DirectClass
Geometry: 1728x2165+0+0
Resolution: 204x98
Print size: 8.47059x22.0918
Units: PixelsPerInch
Type: Bilevel
Base type: Bilevel
Endianess: LSB
Colorspace: RGB
Depth: 1-bit
Channel depth:
gray: 1-bit
Channel statistics:
gray:
min: 0 (0)
max: 1 (1)
mean: 0.0586851 (0.0586851)
standard deviation: 0.235034 (0.235034)
kurtosis: 12.1024
skewness: 3.75532
Histogram:
3521572: ( 0, 0, 0) #000000 black
219548: (255,255,255) #FFFFFF white

No Color Map


Again see tif parameters in IM at http://www.imagemagick.org/Usage/formats/#tiff

-define quantum:polarity=min-is-black
-define quantum:polarity=min-is-white

Best I can do to help! Magick will need to confirm my analysis and explain further or if IM is not handling things properly.
WeBoat

Re: PDF to Tif coming through FAX inverted.

Post by WeBoat »

I'll look into. endiness could be it. These images are converted on a windows box and then ftp'd to a Linux one for transmission. So we are definitely switching byte order. I was going to try imagemagick on the Linux box directly this evening.

I'll let you know if that affects it.

Thanks
Post Reply