A web application that converts DNG (Digital Negative) files to PNG format with two distinct processing modes: API mode for server-side conversion and WASM mode for client-side conversion.
- High-quality conversion using dcraw + Sharp libraries
- Supports large DNG files (up to 50MB)
- Full RAW processing pipeline
- Reliable server-side processing
- Fast browser-based processing using WebAssembly
- Complete privacy - files never leave your device
- Works offline after initial page load
- Instant processing with dcraw.js
- Backend: Node.js + Express + TypeScript
- API Mode: dcraw (Node.js) + Sharp
- WASM Mode: dcraw.js (WebAssembly)
- File Upload: Multer (API mode only)
- Frontend: HTML5 + Vanilla JavaScript
npm installnpm run devAccess at http://localhost:3000 and choose your preferred mode.
npm run dev:apiAccess API mode directly at http://localhost:3001
npm run build
npm start- Open
http://localhost:3000in your browser - Choose between API Mode or WASM Mode
- Upload your DNG file
- Download the converted PNG file
- Best for: Large files, highest quality conversion
- Upload DNG file → Server processes → Download PNG
- Best for: Privacy, speed, offline use
- Select DNG file → Browser processes → Download PNG
Converts DNG files to PNG format.
Request:
- Method: POST
- Content-Type: multipart/form-data
- Body: DNG file (dngFile field)
Response:
{
"message": "Conversion completed successfully.",
"filename": "converted-file.png"
}Downloads the converted PNG file.
npm run test-conversionnpx ts-node test/test-dcraw.tsnpx ts-node test/create-test-image.ts- Input: .dng (Digital Negative) files
- Output: .png (Portable Network Graphics) files
- Maximum file size: 50MB
- Only DNG format supported (other RAW formats not supported)
dng/
├── src/
│ ├── index.ts # Main server with mode selection
│ ├── api-mode/
│ │ ├── index.ts # Standalone API server
│ │ ├── server.ts # API mode router
│ │ └── dng-converter.ts # Server-side conversion logic
│ └── wasm-mode/ # (Client-side processing via static files)
├── public/
│ └── wasm-mode.html # WASM mode interface
├── test/
│ ├── test-conversion.ts # Conversion test script
│ ├── test-dcraw.ts # dcraw library test
│ └── create-test-image.ts # Test image creation
├── uploads/ # Temporary storage for uploaded files
├── test-files/ # Test file storage
├── dist/ # Compiled JavaScript files
├── package.json
├── tsconfig.json
└── README.md
npm run dev- Run main server with mode selection (port 3000)npm run dev:api- Run API mode only (port 3001)npm run test-conversion- Test conversion functionalitynpm run test-dcraw- Test dcraw librarynpm run create-test-image- Create test imagesnpm run build- Build for productionnpm start- Start production server
- Verify the file is in proper DNG format
- Check if file size is under 50MB
- Ensure the file is not corrupted
- Check Node.js version (14.x or higher recommended)
- Verify port 3000 is not in use
- Ensure all dependencies are installed
ISC
This project uses the dcraw WASM library for DNG file processing. DNG is an open RAW format developed by Adobe that standardizes RAW files generated by various cameras.