octave-maintainers
[Top][All Lists]
Advanced

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

Re: imread returns MxNx4 when Matlab returns MxNx3


From: Rik
Subject: Re: imread returns MxNx4 when Matlab returns MxNx3
Date: Mon, 16 May 2011 12:21:03 -0700

On 05/16/2011 10:00 AM, address@hidden wrote:
> When reading a png bitmap, imread() returns an image of size MxNx4,while 
> matlab's imread() returns MxNx3. The extra index causes image() to crash.

Ben,

There is probably an alpha channel in the png image you are trying to read.
 See this bug (https://savannah.gnu.org/bugs/index.php?32986) where the
alpha channel should be broken out, but is instead returned as a fourth
dimension.  Easiest approach is probably to strip the 4th dimension
yourself, but not touch the Octave core functions.

--Rik


reply via email to

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