API Reference
Complete reference for every public export from @pantanal/pixu.
typescript
import {
compress,
compressBatch,
compressStream,
PixuCompressor,
validateImage,
isValidImage,
analyzeImage,
getPresetOptions,
applyPreset,
applyFilter,
applyWatermark,
calculateSmartCrop,
optimizePNG,
convertFormat,
detectTransparency,
shouldConvertToJPEG,
analyzeImageContent,
getSmartQuality,
getOptimizationHints,
estimateCompressionSavings,
generateResponsiveImages,
generateSrcset,
generateSizes,
analyzeColorSpace,
normalizeToSRGB,
supportsWideGamut,
isProgressiveJPEG,
supportsProgressiveJPEG,
PerformanceMonitor,
formatBytes,
formatDuration,
getMemoryInfo,
shouldUseStreaming,
calculateChunkSize,
AdvancedBatchProcessor,
PluginManager,
canvasToPixu,
isPixuSupported,
PIXU_MIME_TYPE,
buildDownloadName,
estimatePixuCompression,
} from '@pantanal/pixu'Core
| Export | Description |
|---|---|
| compress | Compress one image |
| compressBatch | Compress many images with concurrency |
| compressStream | Async generator pipeline |
| PixuCompressor | Class API: abort, plugins, reuse |
| AdvancedBatchProcessor | Retry, priority, pause/cancel |
Validation and analysis
| Export | Description |
|---|---|
validateImage / isValidImage | Pre-flight checks |
| analyzeImage | Content analysis and recommendations |
analyzeImageContent / getSmartQuality | Smart quality helpers |
Transforms and helpers
| Export | Description |
|---|---|
| Presets | getPresetOptions, applyPreset |
| Filters | applyFilter |
| Watermark | applyWatermark |
| Smart crop | calculateSmartCrop |
| PNG optimization | optimizePNG |
| Format conversion | convertFormat, transparency helpers |
| PIXU format | Encode / constants / estimates / preview |
| PIXU encode | TECR path — native .webp / .jpg output |
getOutputExtension / buildDownloadName | Map MIME → file extension for downloads |
| Responsive | generateResponsiveImages, srcset helpers |
| Optimization hints | Hints and savings estimates |
| Color space | sRGB / wide-gamut helpers |
| Progressive JPEG | Detect progressive support |
| Performance | PerformanceMonitor, formatters |
| Memory | Memory / streaming helpers |
| Plugins | PluginManager, Plugin |
Types
See Types for CompressionOptions, CompressionResult, and related unions.
Default export
typescript
import pixu from '@pantanal/pixu'
await pixu.compress(file, { quality: 0.8 })The default export is a shared PixuCompressor instance.
