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

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
tcrass
Posts: 38
Joined: 2009-11-22T11:12:52-07:00
Authentication code: 8675309

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
tcrass
Posts: 38
Joined: 2009-11-22T11:12:52-07:00
Authentication code: 8675309

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

Post 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
tcrass
Posts: 38
Joined: 2009-11-22T11:12:52-07:00
Authentication code: 8675309

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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?
tcrass
Posts: 38
Joined: 2009-11-22T11:12:52-07:00
Authentication code: 8675309

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

I will download the current example later today and check it out.
tcrass
Posts: 38
Joined: 2009-11-22T11:12:52-07:00
Authentication code: 8675309

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

Post by tcrass »

Fred,
fmw42 wrote:I will download the current example later today and check it out.
great! Thank you so much!

Cheers --

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

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

Post 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.
tcrass
Posts: 38
Joined: 2009-11-22T11:12:52-07:00
Authentication code: 8675309

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

Post 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
tcrass
Posts: 38
Joined: 2009-11-22T11:12:52-07:00
Authentication code: 8675309

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

Post 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...
Albert25
Posts: 19
Joined: 2010-06-19T03:57:24-07:00
Authentication code: 8675308

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

Post 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
Post Reply