octave-maintainers
[Top][All Lists]
Advanced

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

reading and writing of images with alpha channel. Breaking backwards com


From: Carnë Draug
Subject: reading and writing of images with alpha channel. Breaking backwards compatibility.
Date: Fri, 2 Aug 2013 16:31:27 +0100

Hi

I've been going through the imread() and imwrite() functions. One
thing that was working very different from Matlab was dealing with the
alpha channel. The alpha channel should be always returned as a
separate value (3rd argument) but it was being returned on the 3rd
dimension of the image.

Basically, a grayscale and RGB image which have sizes MxNx1 and MxNx3,
would have a sizes of MxNx2 and MxNx4. However, a MxNx4 matrix is also
used for a CMYK image. I have already fixed on reading but this breaks
backward compatibility (I'm unsure how many people were using it
anyway). As this was on the return values of a reading function I see
no way to deprecate, only leave a notice on the NEWS file. However,
I'm also going to fix this on the writing function. In this case, the
alpha must be passed as a separate matrix. If the input is a MxNx4
matrix, before would be treated as a RGB image with alpha channel, but
it should actually be treated as a CMYK image. I don't see how to fix
this while keeping backwards compatibility unless we print warnings
for even when people were doing the actually correct thing.

Carnë


reply via email to

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