# How is the matrix/array arranged after stretching each image data into one column?

**URL:** <https://community.deeplearning.ai/t/how-is-the-matrix-array-arranged-after-stretching-each-image-data-into-one-column/409750>\
**Category:** Neural Networks and Deep Learning\
**Tags:** coursera-platform\
**Created:** [August 6, 2023, 12:45pm UTC](https://community.deeplearning.ai/t/how-is-the-matrix-array-arranged-after-stretching-each-image-data-into-one-column/409750 "2023-08-06T12:45:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [August 6, 2023, 2:47pm UTC](https://community.deeplearning.ai/t/how-is-the-matrix-array-arranged-after-stretching-each-image-data-into-one-column/409750/2 "2023-08-06T14:47:22Z")

</div>

It’s a great question and it has come up before: [Here’s a thread](https://community.deeplearning.ai/t/flattening-images-in-the-logistic-regression-assignment-in-course-1-week-2/149) which goes through the flattening process in detail. Make sure to also read the later posts there that discuss the difference between the “C” ordering (the default) and the “F” ordering.

The short answer is that the “C” order (the default) gives you all 3 color values for each pixel location together. If you use the “F” order, then you get all the red pixel values, followed by all the green pixel values, followed by the blue. So that method gives you the equivalent of 3 monochrome images back to back. The other high level point is that the algorithm can learn to recognize the patterns in either order, as long as you are consistent and always use the same method. See the thread for concrete demonstrations of this.

---

_[View the full topic](https://community.deeplearning.ai/t/how-is-the-matrix-array-arranged-after-stretching-each-image-data-into-one-column/409750)._
