Sahaj.blogs

Day page

1 Aug 2025

Study

Computer Vision · Image basics

Images as arrays: height × width × channels, uint8 vs float, RGB vs grayscale, cropping, and the channel-order and range traps between libraries.

  • A colour image is just an H × W × 3 array of numbers, usually uint8 from 0 to 255.
  • PyTorch wants channels first (C × H × W) and floats in [0, 1]; most image libraries give channels last.

Read the post →