what does the 3rd parameter of returned array.shape mean?

15 views
Skip to first unread message

进陆

unread,
Sep 8, 2016, 7:11:13 AM9/8/16
to imageio
imageio.imread('./test-24bpp.jpg').shape returns [height, width, 3], so I think 3 means there are 3 uint8-2d-array(i.e., R/G/B)

but
imageio.imread('./test-8bpp.bmp').shape returns [height, width, 4], what does 4 means?
imageio.imread('./test.gif')[0].shape returns [height, width, 4], what does 4 means?

Thanks

Almar Klein

unread,
Sep 8, 2016, 7:42:27 AM9/8/16
to 进陆, imageio

If shape[2] == 3, then it means RGB, if it’s 4, it means RGBA, the fourth element is the alpha (transparency).

 

Regards,

  Almar

--
You received this message because you are subscribed to the Google Groups "imageio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to imageio+u...@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at https://groups.google.com/group/imageio.
For more options, visit https://groups.google.com/d/optout.

 

Reply all
Reply to author
Forward
0 new messages