help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem loading 16bit images using imread()


From: Carnë Draug
Subject: Re: Problem loading 16bit images using imread()
Date: Tue, 6 Aug 2013 01:27:41 +0100

On 5 August 2013 13:38,  bmgamm <address@hidden> wrote:
> Hello,
>
> I'm having a problem loading 16-bit TIFFs using imread() with Octave 3.6.2
> and image. The images are loaded but down-sampled to 8-bit. I reviewed the
> forum postings related to this problem and them seem to focus on the issue
> of compiling GraphicsMagick with Q16 rather then Q8. I'll admit that I don't
> program in C++ and much of the conversation regarding compiling is over my
> head. Nevertheless, I'm not sure I'm having the same problem. The warning
> message presented to me was as follows:
>
> />> TestImage = imread('FileName.tif');
> warning: your version of GraphicsMagick limits images to 16 bits per pixel/
>
> So, it seems like GraphicsMagick is compiled with the proper quantum depth,
> though I don't know why I would receive this warning if I'm loading a 16-bit
> image.

GraphicsMagick (GM) will not tell us the bitdepth of an image if
higher than the quantum used to build it. For example, if you build GM
with quantum 16, images with bitdepth 8, 16 and 32 will report being
8, 16, and 16. The value reported is capped by how it was built. So
the warning is always issued if you built GM with quantum lower than
32. GM reports that the image is in 16 bit but for all we know, it may
be 32bit, and being limited by your build.

That's a warning. If you're confident that your images don't have a
bitdepth higher than 16bit per channel, you can ignore it.

> Furthermore, when I run imfinfo('FileName.tif'), a 2x1 structure is
> returned with the following fields. The first element is listed. If the
> second element was different, it is shown in parentheses. I'm thinking that
> the second element is a thumbnail embedded in the image and the first image
> is the main file. However, the bit depth is listed as 16 bit for the main
> image.
>
>     /Filename = PATH\FileName.tif
>     FileModDate =  5-Aug-2013 10:18:21
>     FileSize =  16125377
>     Height =  1330 (S2: 106)
>     Width =  2000 (S2: 160)
>     BitDepth =  16 (S2: 8)
>     Format = TIFF
>     LongFormat = Tagged Image File Format
>     XResolution =  300
>     YResolution =  300
>     TotalColors =  37846 (S2: 2781)
>     TileName =
>     AnimationDelay = 0
>     AnimationIterations = 0
>     ByteOrder = undefined
>     Gamma = 0
>     Matte = 0
>     ModulusDepth =  8
>     Quality =  75
>     QuantizeColors =  256
>     ResolutionUnits = undefined
>     ColorType = truecolor
>     View = /
>
> I would appreciate any suggestions someone might have on how to properly
> load 16-bit images into Octave. Thank you.

I had images like this before, every other image is a thumbnail of the
previous one. The best way to read this is to use:

img = imread (filename, 1:2:numel (imfinfo (filename)));

Carnë


reply via email to

[Prev in Thread] Current Thread [Next in Thread]