Page 1 of 1

48 bit tiff: no-op convert results in pixel noise

Posted: 2016-02-29T13:59:03-07:00
by tcrass
Hi there,

once again I'm not sure if I'm just too stupid to use ImageMagick or if it's a real bug... So here's the story:

I have some 48 bit TIFF files. When just loading and saving them using convert like in

Code: Select all

convert in.tif out.tif
the resulting out.tif looks like mere pixel noise, with the outlines of the objects depicted on the input image faintly shining through -- as if some kind of edge detection had been applied to it...

When converting to some other output format, like jpg, colors are preserved perfectly, though. (Example see Image)

So I guess I must be missing some command-line option required to tell ImageMagick to not do, well, some kind of magic, or there must be a bug in the TIFF writing routine.

Any ideas?

-- Torsten

P.S. I'm on a 64 bit Debian Jessie system, using ImageMagick 6.8.9-9 Q16 x86_64

Re: 48 bit tiff: no-op convert results in pixel noise

Posted: 2016-02-29T14:11:40-07:00
by fmw42
Can you post one of your 48-bit Tiff images, so others can test with it?

What is your version of libtiff?

You can see versions from

Code: Select all

convert -list format
or

Code: Select all

tiffinfo

Re: 48 bit tiff: no-op convert results in pixel noise

Posted: 2016-03-01T01:45:56-07:00
by tcrass
Fred,

I was reluctant to post any of those tiffs 'cause they're really huge (not less than 150 MB), but anyway... I uploaded one to http://www.tcrass.de/files/tmp/01.tif.

Regarding the libtiff version, I haven't checked yet; I'll do as soon as I get home.

Cheers --

-- Torsten

Re: 48 bit tiff: no-op convert results in pixel noise

Posted: 2016-03-01T08:23:40-07:00
by tcrass
Hi,

it seems neither
fmw42 wrote: What is your version of libtiff?

You can see versions from

Code: Select all

convert -list format
nor
fmw42 wrote:

Code: Select all

tiffinfo
would tell me which version of libtiff is installed, but according to Debian package management info I have libtiff 4.0.3-12.3.

Cheers --

-- Torsten

Re: 48 bit tiff: no-op convert results in pixel noise

Posted: 2016-03-01T10:16:13-07:00
by fmw42
When I do convert -list format, I get

TIFF* TIFF rw+ Tagged Image File Format (LIBTIFF, Version 4.0.6)

I am surprised that you do not get something like this.

What do you get from

Code: Select all

convert -version
Does it list Tiff or libtiff?


Might you have a smaller 48-bit image that you could provide?

Re: 48 bit tiff: no-op convert results in pixel noise

Posted: 2016-03-01T12:07:25-07:00
by tcrass
Fred,
fmw42 wrote:When I do convert -list format, I get

TIFF* TIFF rw+ Tagged Image File Format (LIBTIFF, Version 4.0.6)

I am surprised that you do not get something like this.
sorry, my fault -- I grepped the output of

Code: Select all

convert -list format
for 'tif', but without the

Code: Select all

-i
option, so I missed the all-capitals TIFF lines...

So here's what my ImageMagick installation says about TIFF:

Code: Select all

     TIFF* TIFF      rw+   Tagged Image File Format (LIBTIFF, Version 4.0.3)
   TIFF64* TIFF      rw-   Tagged Image File Format (64-bit) (LIBTIFF, Version 4.0.3)
fmw42 wrote:What do you get from

Code: Select all

convert -version

Code: Select all

Version: ImageMagick 6.8.9-9 Q16 x86_64 2015-01-05 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib
So yes, it does mention tiff.
fmw42 wrote:Might you have a smaller 48-bit image that you could provide?
Unfortunately not... And obviously I can't use ImageMagick to scale/crop one of those tiffs, can I? I just cropped one down using DigiKam, but -- funny enough -- when converting the image thus cropped like in

Code: Select all

convert cropped-in.tif cropped-out.tif
, the resulting image looks fine! So it must be something in the original TIFFs which prevents IM from handling them correctly.

Cheers --

-- Torsten

Re: 48 bit tiff: no-op convert results in pixel noise

Posted: 2016-03-01T12:20:44-07:00
by fmw42
I will download the current example later today and check it out.

Re: 48 bit tiff: no-op convert results in pixel noise

Posted: 2016-03-01T13:08:38-07:00
by tcrass
Fred,
fmw42 wrote:I will download the current example later today and check it out.
great! Thank you so much!

Cheers --

-- Torsten

Re: 48 bit tiff: no-op convert results in pixel noise

Posted: 2016-03-01T16:18:40-07:00
by fmw42
It converts fine for me on IM 6.9.3.5 Q16 Mac OSX using libtif 4.0.6. So I would suggest either upgrading IM or libtiff or both.

Re: 48 bit tiff: no-op convert results in pixel noise

Posted: 2016-03-02T00:43:58-07:00
by tcrass
Hi,

usually I avoid bypassing the distribution's package management system when installing software, but I gave libtiff (4.0.6-1) from the current Debian Testing release a try -- and it worked! No more pixel noise! So in the case of ImageMagick the verdict is "not guilty" ;)

I'll file a bug report with Debian, asking them to update the libtiff version distributed in the Stable branch.

Thanks again for having a look at this issue --

-- Torsten

Re: 48 bit tiff: no-op convert results in pixel noise

Posted: 2016-03-02T00:48:57-07:00
by tcrass
Just realized that corresponding bug reports have already been filed: https://bugs.debian.org/cgi-bin/bugrepo ... bug=787966 and https://bugs.debian.org/cgi-bin/bugrepo ... bug=786910...

Re: 48 bit tiff: no-op convert results in pixel noise

Posted: 2016-10-24T03:51:55-07:00
by Albert25
Also Debian bug 818360 which suggests the same workaround for Debian Jessie: installing the 4.0.6 version from Stretch:

Code: Select all

wget ftp://ftp.debian.org/debian/pool/main/t/tiff/libtiff5_4.0.6-2_amd64.deb
dpkg -i libtiff5_4.0.6-2_amd64.deb