Image Interpolation
Image Interpolation (Pixel Resampling)
Image interpolation is the method used to calculate new pixel values when resizing an image. Different algorithms (nearest-neighbor, bilinear, bicubic, Lanczos) trade speed for quality when scaling images up or down.
ๆๆฏ็ป่
Nearest-neighbor copies the closest pixel (fastest, blocky). Bilinear averages 4 neighbors. Bicubic uses 16 neighbors with cubic weighting. Lanczos uses a sinc-based windowed filter for the sharpest results.
็คบไพ
```javascript
// Image compression via Canvas
canvas.toBlob(
blob => console.log(`Size: ${(blob.size/1024).toFixed(0)} KB`),
'image/jpeg',
0.8 // quality: 0.0 (smallest) to 1.0 (best)
);
// WebP output (25-34% smaller than JPEG)
canvas.toBlob(cb, 'image/webp', 0.8);
```
็ธๅ ณๅทฅๅ ท
ๅ
ๅ็ผฉๅพ็
่ฐ
่ฐๆดๅพ็ๅคงๅฐ
่ฃ
่ฃๅชๅพ็
ๆ
ๆ่ฝฌๅพ็
็ฟป
็ฟป่ฝฌๅพ็
่ฝฌ
่ฝฌๆขๅพ็ๆ ผๅผ
ๅพ
ๅพ็ๆทปๅ ๆฐดๅฐ
S
SVG ่ฝฌ PNG
ๅพ
ๅพ็่ฝฌ Base64
ๅ
ๅ่งๅค็
ๆทป
ๆทปๅ ่พนๆก
ๅพ
ๅพ็ๆปค้
่ฐ
่ฐๆดๅพ็
ๆจก
ๆจก็ณๅพ็
้
้ๅๅพ็
่ฃ
่ฃๅชไธบๆญฃๆนๅฝข
G
Grayscale Image
S
Sepia Image
P
Pixelate Image
S
Strip Image Metadata