๐Ÿ‹
Menu
Image

DPI

DPI (Dots Per Inch)

A measurement of print density that indicates how many individual dots of ink a printer places within one inch. In digital imaging, DPI (often used interchangeably with PPI) describes how many pixels map to one physical inch when printed.

ๆŠ€่ก“็š„่ฉณ็ดฐ

Strictly, DPI applies to printers and PPI (Pixels Per Inch) applies to screens and digital images, but the terms are commonly conflated. A 3000x2000 pixel image printed at 300 DPI produces a 10x6.67 inch print. The DPI value stored in image metadata (EXIF, TIFF tags) is advisory and does not affect the pixel data itself. For web display, DPI metadata is irrelevant since browsers render at the screen's native pixel density. Retina/HiDPI displays use 2x-3x pixel density, requiring higher-resolution source images for crisp rendering.

ไพ‹

```javascript
// DPI: 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)
```

้–ข้€ฃใƒ„ใƒผใƒซ

้–ข้€ฃ็”จ่ชž