convert produces distorted TIFF file (ImageMagick ImageMagick-6.9.1-0) SOLVED
convert produces distorted TIFF file (ImageMagick ImageMagick-6.9.1-0) SOLVED
This TIFF file gets distorted when saved by "convert".
http://dropcanvas.com/qy8j0/2 (link is a zip file with the TIFF inside)
Example command line:
convert example.tiff tiff:2.tiff
File is produced with the scanner utility included in MacOSX.
Update:
This is on Ubuntu 14.04. TIFF-related package versions if thats relevant:
ii libtiff5:i386 4.0.3-7ubuntu0.2
ii libtiff5-dev:i386 4.0.3-7ubuntu0.2
ii libtiffxx5:i386 4.0.3-7ubuntu0.2
Update 2:
This is what the resulting image looks like:
http://dropcanvas.com/qy8j0/2 (link is a zip file with the TIFF inside)
Example command line:
convert example.tiff tiff:2.tiff
File is produced with the scanner utility included in MacOSX.
Update:
This is on Ubuntu 14.04. TIFF-related package versions if thats relevant:
ii libtiff5:i386 4.0.3-7ubuntu0.2
ii libtiff5-dev:i386 4.0.3-7ubuntu0.2
ii libtiffxx5:i386 4.0.3-7ubuntu0.2
Update 2:
This is what the resulting image looks like:
Last edited by jogco on 2015-04-10T12:02:29-07:00, edited 1 time in total.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: convert produces distorted TIFF file (ImageMagick ImageMagick-6.9.1-0)
What should the image look like?
For me, IM v6.9.1-0 on Windows 8.1, the result is mostly light.
For me, IM v6.9.1-0 on Windows 8.1, the result is mostly light.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert produces distorted TIFF file (ImageMagick ImageMagick-6.9.1-0)
Works fine for me under IM 6.9.1.0 Q16 Mac OSX. Looks mostly white. My libtiff is 4.0.3. Perhaps it is an endian issue on your system. See http://www.imagemagick.org/script/comma ... php#define for tiff:endian or tiff:fill-order?
Re: convert produces distorted TIFF file (ImageMagick ImageMagick-6.9.1-0)
Thanks for the suggestion. I tried these combinations:
convert -define tiff:endian=msb example.tiff out.tiff
convert -define tiff:endian=lsb example.tiff out.tiff
convert -define tiff:fill-order=msb example.tiff out.tiff
convert -define tiff:fill-order=lsb example.tiff out.tiff
convert -define tiff:endian=msb -define tiff:fill-order=msb example.tiff out.tiff
convert -define tiff:endian=lsb -define tiff:fill-order=lsb example.tiff out.tiff
Same result...
And for reference here is a zip with the distorted file I get and full version info:
http://dropcanvas.com/wwemj/1
$ convert -version
Version: ImageMagick 6.9.1-0 Q16 i686 2015-04-03 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: DPC OpenMP
Delegates (built-in): fontconfig freetype jbig jng jpeg lzma pangocairo png tiff webp x xml zlib
convert -define tiff:endian=msb example.tiff out.tiff
convert -define tiff:endian=lsb example.tiff out.tiff
convert -define tiff:fill-order=msb example.tiff out.tiff
convert -define tiff:fill-order=lsb example.tiff out.tiff
convert -define tiff:endian=msb -define tiff:fill-order=msb example.tiff out.tiff
convert -define tiff:endian=lsb -define tiff:fill-order=lsb example.tiff out.tiff
Same result...
And for reference here is a zip with the distorted file I get and full version info:
http://dropcanvas.com/wwemj/1
$ convert -version
Version: ImageMagick 6.9.1-0 Q16 i686 2015-04-03 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: DPC OpenMP
Delegates (built-in): fontconfig freetype jbig jng jpeg lzma pangocairo png tiff webp x xml zlib
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert produces distorted TIFF file (ImageMagick ImageMagick-6.9.1-0)
Is it possible you have more than one version of IM or libtiff? I do not get that dark result. It is mostly white. Does
type -a
or
which -a
entered in a terminal give you more than one IM?
What version of libtiff?
convert -list format
should show the version. Mine is LIBTIFF, Version 4.0.3
Do you get a different result with the -defines after the input image so that they apply to the output image?
type -a
or
which -a
entered in a terminal give you more than one IM?
What version of libtiff?
convert -list format
should show the version. Mine is LIBTIFF, Version 4.0.3
Do you get a different result with the -defines after the input image so that they apply to the output image?
Re: convert produces distorted TIFF file (ImageMagick ImageMagick-6.9.1-0)
i'm using imagemagick compiled from source, so in reality the command line I use is something like
$ ImageMagick-6.9.1-0/utilities/convert infile.tiff outfile.tiff
(I have tried the version of convert that comes with ubuntu 14.04 as well (ImageMagick 6.7.7-10 2014-03-06 Q16), with exactly the same result)
Putting the define after the input file:
$ ImageMagick-6.9.1-0/utilities/convert example.tiff -define tiff:endian=msb -define tiff:fill-order=msb out-msb-msb.tiff
$ ImageMagick-6.9.1-0/utilities/convert example.tiff -define tiff:endian=lsb -define tiff:fill-order=lsb out-lsb-lsb.tiff
$ ImageMagick-6.9.1-0/utilities/convert example.tiff -define tiff:endian=lsb -define tiff:fill-order=msb out-lsb-msb.tiff
$ ImageMagick-6.9.1-0/utilities/convert example.tiff -define tiff:endian=msb -define tiff:fill-order=lsb out-msb-lsb.tiff
Same result.
TIFF version:
$ ImageMagick-6.9.1-0/utilities/convert -list format | grep -i tiff
EPT rw- Encapsulated PostScript with TIFF preview
EPT2 rw- Encapsulated PostScript Level II with TIFF preview
EPT3 rw+ Encapsulated PostScript Level III with TIFF preview
PTIF* rw+ Pyramid encoded TIFF
TIFF* rw+ Tagged Image File Format (LIBTIFF, Version 4.0.3)
TIFF64* rw- Tagged Image File Format (64-bit) (LIBTIFF, Version 4.0.3)
Btw, the result I expect is to get an image thats identical to the input image, ie mostly white. Like this:
.
Im trying to batch rotate around 500 tiff files and everyone I've tried so far gets distorted.
They are all produced by Mac OSX Image Capture.
$ ImageMagick-6.9.1-0/utilities/convert infile.tiff outfile.tiff
(I have tried the version of convert that comes with ubuntu 14.04 as well (ImageMagick 6.7.7-10 2014-03-06 Q16), with exactly the same result)
Putting the define after the input file:
$ ImageMagick-6.9.1-0/utilities/convert example.tiff -define tiff:endian=msb -define tiff:fill-order=msb out-msb-msb.tiff
$ ImageMagick-6.9.1-0/utilities/convert example.tiff -define tiff:endian=lsb -define tiff:fill-order=lsb out-lsb-lsb.tiff
$ ImageMagick-6.9.1-0/utilities/convert example.tiff -define tiff:endian=lsb -define tiff:fill-order=msb out-lsb-msb.tiff
$ ImageMagick-6.9.1-0/utilities/convert example.tiff -define tiff:endian=msb -define tiff:fill-order=lsb out-msb-lsb.tiff
Same result.
TIFF version:
$ ImageMagick-6.9.1-0/utilities/convert -list format | grep -i tiff
EPT rw- Encapsulated PostScript with TIFF preview
EPT2 rw- Encapsulated PostScript Level II with TIFF preview
EPT3 rw+ Encapsulated PostScript Level III with TIFF preview
PTIF* rw+ Pyramid encoded TIFF
TIFF* rw+ Tagged Image File Format (LIBTIFF, Version 4.0.3)
TIFF64* rw- Tagged Image File Format (64-bit) (LIBTIFF, Version 4.0.3)
Btw, the result I expect is to get an image thats identical to the input image, ie mostly white. Like this:
.
Im trying to batch rotate around 500 tiff files and everyone I've tried so far gets distorted.
They are all produced by Mac OSX Image Capture.
Re: convert produces distorted TIFF file (ImageMagick ImageMagick-6.9.1-0)
Here is another example.
Input:
Output:
Input:
Output:
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: convert produces distorted TIFF file (ImageMagick ImageMagick-6.9.1-0)
Both those files are JPG. What command(s) did you use?
"-define tiff:endian=msb" shouldn't make any difference, as the source file example.tiff is 1 byte/pixel.
Does the same problem occur when reading or writing other file types such as PNG or JPG?
EDIT: Another factor is the profile in example.tiff. Does "-strip" make any difference?
"-define tiff:endian=msb" shouldn't make any difference, as the source file example.tiff is 1 byte/pixel.
Does the same problem occur when reading or writing other file types such as PNG or JPG?
EDIT: Another factor is the profile in example.tiff. Does "-strip" make any difference?
snibgo's IM pages: im.snibgo.com
Re: convert produces distorted TIFF file (ImageMagick ImageMagick-6.9.1-0)
Here is the original: http://dropcanvas.com/96ols/1
And the output: http://dropcanvas.com/96ols/2
I tried the -strip option. No difference.
I can convert example2.tiff to png and the png looks as it should but if I convert it back to a tiff i get the usual result. So there is obviously something wrong with the ability to write tiff files in my version of ImageMagick/convert. I have also tried various other image files now. What I have found so far is that converting from jpeg to tiff always works, but converting from tiff to tiff or from png to tiff never works... If png to tiff had worked I could have used png as a intermediate format in my batch processing. I dont want to lose quality by using jpeg.
I guess the next step is removing both libtiff and imagemagick completely from the system and installing both from source, latest versions, and see what I get. This is crazy.
And the output: http://dropcanvas.com/96ols/2
I tried the -strip option. No difference.
I can convert example2.tiff to png and the png looks as it should but if I convert it back to a tiff i get the usual result. So there is obviously something wrong with the ability to write tiff files in my version of ImageMagick/convert. I have also tried various other image files now. What I have found so far is that converting from jpeg to tiff always works, but converting from tiff to tiff or from png to tiff never works... If png to tiff had worked I could have used png as a intermediate format in my batch processing. I dont want to lose quality by using jpeg.
I guess the next step is removing both libtiff and imagemagick completely from the system and installing both from source, latest versions, and see what I get. This is crazy.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert produces distorted TIFF file (ImageMagick ImageMagick-6.9.1-0)
Code: Select all
Btw, the result I expect is to get an image thats identical to the input image, ie mostly white. Like this:
Code: Select all
convert original.tiff result.tiff
Have you added any lines to your delegates.xml file for tiff such that you change black to white?
Re: convert produces distorted TIFF file (ImageMagick ImageMagick-6.9.1-0) SOLVED
Apparently it was some kind of issue in libtiff 4.0.3-7ubuntu0.2 that is solved in 4.0.3-7ubuntu0.3
Re: convert produces distorted TIFF file (ImageMagick ImageMagick-6.9.1-0) SOLVED
Thanks for coming back to the forum, this will be helpful for someone who will find this post in the future.