Page 1 of 1

PDF to Tif coming through FAX inverted.

Posted: 2009-08-25T08:04:04-07:00
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

Re: PDF to Tif coming through FAX inverted.

Posted: 2009-08-25T10:29:32-07:00
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

Re: PDF to Tif coming through FAX inverted.

Posted: 2009-08-25T10:37:05-07:00
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.

Re: PDF to Tif coming through FAX inverted.

Posted: 2009-08-26T07:13:34-07:00
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

Re: PDF to Tif coming through FAX inverted.

Posted: 2009-08-26T07:27:42-07:00
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

Re: PDF to Tif coming through FAX inverted.

Posted: 2009-08-26T07:47:46-07:00
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.

Re: PDF to Tif coming through FAX inverted.

Posted: 2009-08-27T08:20:47-07:00
by WeBoat
Bump .... any ideas? We are about to put imagemagick in the "doesn't work" category.

Thanks

Re: PDF to Tif coming through FAX inverted.

Posted: 2009-08-27T08:47:46-07:00
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!!!!!

Re: PDF to Tif coming through FAX inverted.

Posted: 2009-08-27T08:48:18-07:00
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.

Re: PDF to Tif coming through FAX inverted.

Posted: 2009-08-29T06:09:37-07:00
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.

Re: PDF to Tif coming through FAX inverted.

Posted: 2009-08-29T11:05:43-07:00
by fmw42
I repeat, your images cannot be downloaded --- Error cant get to server

Re: PDF to Tif coming through FAX inverted.

Posted: 2009-08-29T12:10:43-07:00
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

Re: PDF to Tif coming through FAX inverted.

Posted: 2009-08-29T15:20:59-07:00
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.

Re: PDF to Tif coming through FAX inverted.

Posted: 2009-08-29T15:23:27-07:00
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