πŸ‹
Menu
Image

Bit Depth

Bit Depth (Color Depth / Bits Per Pixel)

Bit depth determines the number of possible color values each pixel can represent. Higher bit depths allow more colors and smoother gradients: 8-bit provides 256 values per channel (16.7M colors), while 16-bit provides 65,536.

기술 세뢀사항

Total color count is calculated as 2^(bits_per_channel * num_channels). A 24-bit image uses 8 bits each for red, green, and blue, yielding 2^24 = 16,777,216 possible colors.

μ˜ˆμ‹œ

```javascript
// Bit Depth: processing with Canvas API
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
ctx.drawImage(sourceImage, 0, 0);
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
// Process pixels in imageData.data (RGBA array)
```

κ΄€λ ¨ 도ꡬ

κ΄€λ ¨ μš©μ–΄