png2dds-converter
v1.0.0
Published
A lightweight, dependency-free PNG to DDS converter
Downloads
9
Readme
PNG to DDS Converter
A lightweight, dependency-free PNG to DDS converter that transforms PNG files to uncompressed DDS format. Perfect for game development and texture processing pipelines.
Features
- No external dependencies
- Supports both RGB and RGBA PNG files
- Preserves correct color channels
- Command-line interface
- TypeScript support
- Can be used programmatically in Node.js applications
Installation
npm install -g png2dds-converterOr install locally in your project:
npm install png2dds-converterUsage
Command Line
# Basic usage (output will be input.dds)
png2dds input.png
# Specify output file
png2dds input.png output.ddsProgrammatic Usage
import { PNG2DDS } from 'png2dds-converter';
// Convert PNG to DDS
PNG2DDS.convert('input.png', 'output.dds');
// Or let it use the default output path (same as input but with .dds extension)
PNG2DDS.convert('input.png');Supported PNG Types
- RGB (Color Type 2)
- RGBA (Color Type 6)
- 8-bit per channel
DDS Output Format
The converter creates uncompressed DDS files with the following specifications:
- RGBA8 format (32 bits per pixel)
- No mipmaps
- Standard RGB color order
- Proper alpha channel support
Error Handling
The converter includes comprehensive error handling:
- Validates PNG file format
- Checks for supported color types
- Reports detailed error messages
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details
