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.