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

Fabien fabien.maussion at gmail.com
Thu Aug 6 15:37:33 CEST 2015


Thanks Ben & Tom for your responses, I guess it makes sense that way.

Cheers,

Fabien


On 08/05/2015 03:36 PM, Thomas Caswell wrote:
> 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 <mailto: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
>     <mailto: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
>         <mailto:Matplotlib-users at python.org>
>         https://mail.python.org/mailman/listinfo/matplotlib-users
>
>
>     _______________________________________________
>     Matplotlib-users mailing list
>     Matplotlib-users at python.org
>     <mailto: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
>




More information about the Matplotlib-users mailing list