[Matplotlib-users] Why are matplotlib RGB images of dimensions (row, column, plane)

Thomas Caswell tcaswell at gmail.com
Wed Aug 5 15:36:54 CEST 2015


See http://scikit-image.org/docs/dev/user_guide/numpy_images.html and the
discussion at https://github.com/scikit-image/scikit-image/pull/1280.

skimage documents [rr, cc, ch] as the 'standard' for RGB(A) images (
http://scikit-image.org/docs/dev/user_guide/numpy_images.html#coordinate-conventions
)

In general RGB color channels have a very different meaning that planes.
The former is a result of internal details of a camera, where as the later
is the result of changing something in data acquisition (in cases where
color is one of the experimental controls it is a plane because you are
probably not collecting exactly RGB and are going to composite down to get
a RGB (false) color image).

Tom

On Wed, Aug 5, 2015 at 9:09 AM Benjamin Root <ben.root at ou.edu> wrote:

> I think it has to do with the conventions used by PIL way back in the day.
> To me, the current conventions make sense to me because imshow can work
> with just a simple 2D image. Color is then additional dimensions (and thus
> at the end).  If I slice up an image like so: `im[20:40, 50:80]`, then
> imshow will work as expected regardless if that image was a 2D grayscale
> image or a 3D RGB[A] image.
>
> Cheers!
> Ben Root
>
> On Wed, Aug 5, 2015 at 4:02 AM, Fabien <fabien.maussion at gmail.com> wrote:
>
>> Hi all,
>>
>> just to follow up a quite intense discussion on the numpy mailing list
>> about dimensions ordering: why are matplotlib RGB images of dimensions
>> (row, column, plane) instead of the standard (plane, row, column)?
>>
>> I guess this has been asked thousand times but I can't seem to find the
>> answer...
>>
>> Thanks!
>>
>> Fabien
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Matplotlib-users at python.org
>> https://mail.python.org/mailman/listinfo/matplotlib-users
>>
>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20150805/3741629f/attachment.html>


More information about the Matplotlib-users mailing list