A TypeScript library to extract Fujifilm camera recipe data from EXIF maker notes.
This library parses Fujifilm camera maker notes from EXIF data to extract film simulation recipes and camera settings. It supports extracting various parameters like film mode, grain effects, color settings, white balance, dynamic range, and tone adjustments.
pnpm add fuji-recipes
import getRecipe from 'fuji-recipes'
const makerNote = [] // You can get makerNote using exifr or other tools.
const recipe = getRecipe(makerNote)
To extract maker notes from actual photos, you'll need an EXIF parsing library like exifr
:
npm install exifr
import fs from 'node:fs/promises'
import exifr from 'exifr'
import getRecipe from 'fuji-recipes'
async function extractRecipeFromPhoto(photoPath: string) {
const photo = await fs.readFile(photoPath)
const exif = await exifr.parse(photo, { makerNote: true })
if (exif.makerNote) {
const recipe = getRecipe(exif.makerNote)
return recipe
}
throw new Error('No maker note found in the photo')
}
// Usage
const recipe = await extractRecipeFromPhoto('./fuji-photo.jpg')
console.log(recipe)
{
"FilmMode": "Classic Chrome",
"GrainEffectRoughness": "Off",
"GrainEffectSize": "Off",
"ColorChromeEffect": "Off",
"ColorChromeFxBlue": "Strong",
"WhiteBalance": "5500K",
"Red": "-1",
"Blue": "+1",
"DynamicRange": "DR400",
"HighlightTone": "-1",
"ShadowTone": "-1",
"Saturation": "+1",
"Sharpness": "0",
"NoiseReduction": "0",
"Clarity": "0"
}
The library extracts the following camera settings:
- FilmMode: Film simulation mode
- GrainEffectRoughness: Grain effect intensity
- GrainEffectSize: Grain size
- ColorChromeEffect: Color chrome effect setting
- ColorChromeFxBlue: Blue color chrome effect
- WhiteBalance: White balance setting
- Red: Red white balance fine-tune
- Blue: Blue white balance fine-tune
- DynamicRange: Dynamic range setting
- HighlightTone: Highlight tone adjustment
- ShadowTone: Shadow tone adjustment
- Saturation: Color saturation adjustment
- Sharpness: Sharpness setting
- NoiseReduction: Noise reduction level
- Clarity: Clarity adjustment
Extracts recipe data from a Fujifilm maker note.
Parameters:
makerNote
: The maker note data as a Buffer or array of numbers
Returns:
- An object containing the extracted recipe parameters
- Node.js 20+
- pnpm
# Install dependencies
pnpm install
# Run tests
pnpm test
# Build the library
pnpm build
The library includes comprehensive tests with real maker note data:
pnpm test
This library is based on the Fujifilm MakerNote tag specifications:
- Exiv2 Fujifilm MakerNote Tags - Comprehensive reference for Fujifilm EXIF MakerNote tags
- ExifTool MakerNote Types - Database of MakerNote formats for various camera manufacturers
MIT
cuvii i@cuvii.dev
- fuji
- fujifilm
- exif
- makernote
- film simulation
- camera recipes