# Rawelier lens profiles (from the Lensfun database)

This folder holds the lens profiles that the Rawelier photo editor uses to correct lens distortion and vignetting:
1,574 lenses, 1,059 cameras, 52 mounts, 6,500 distortion and 19,040 vignetting entries.

They are an adaptation of the **Lensfun lens database** (https://github.com/lensfun/lensfun/tree/37238fcef563196fb798f6151cb9023968b26c40/data/db), copy 37238fcef5 of 2026-11-17, made by the Lensfun
project and the many people who have contributed calibrations to it. Lensfun's database is licensed under the
**Creative Commons Attribution-ShareAlike 3.0** licence (CC BY-SA 3.0), and so is this adaptation: you may copy, share and
adapt it, also commercially, as long as you credit the sources and share your own adaptations under the same licence. See
`LICENSE.md`.

Lensfun and its contributors do not endorse Rawelier. For a complete, maintained database and the library that applies it,
go to Lensfun: https://lensfun.github.io

## Files

| File | What it is |
| --- | --- |
| `rawelier-lens-profiles.txt` | The profiles, byte for byte as the app carries them (UTF-8, tab-separated, one record per line). |
| `LICENSE.md` | Attribution and licence. |
| `SHA256SUMS` | SHA-256 digests of the files. |

SHA-256 of `rawelier-lens-profiles.txt`: `7d21af2839f8c9ac7bc9bbfae26dc6f4e0db81acb3ea7905b7ccecbdd55983e9`

## What was changed from Lensfun

- The XML files were converted into the compact text format described below.
- Only what the app uses was kept: mounts and their compatible mounts; cameras with a crop factor; and lenses with a
  distortion calibration (`ptlens`, `poly3` or `poly5`) or a vignetting calibration (`pa`). Everything else was left out,
  for example chromatic aberration (TCA) and crop calibrations, the lens type, and lenses without those calibrations.
- `poly3` distortion is written in the `ptlens` form, as a = 0, b = k1, c = 0 (the same polynomial).
- Vignetting entries of one focal length and aperture whose coefficients are the same at every distance are written once,
  at distance 1000.
- Numbers are written with at most 7 significant digits. A lens without a crop factor gets 1 and one without an aspect ratio
  gets 1.5; an aspect ratio such as 3:2 is written as a decimal.
- In names, tabs became spaces, runs of spaces became one, and `|` became `/` (`|` separates alternative names).

## Record format

One record per line, fields separated by tabs. `D`, `P` and `V` records belong to the `L` record above them.

| Record | Fields |
| --- | --- |
| `M` | mount name, compatible mounts separated by `\|` |
| `C` | camera maker, models separated by `\|`, mount, crop factor |
| `L` | lens maker, models separated by `\|`, mounts separated by `\|`, crop factor of the calibration, aspect ratio of the calibration |
| `D` | focal length (mm), a, b, c: Lensfun `ptlens` distortion |
| `P` | focal length (mm), k1, k2: Lensfun `poly5` distortion |
| `V` | focal length (mm), aperture (f-number), distance (m), k1, k2, k3: Lensfun `pa` vignetting |

The coefficients are Lensfun's, with Lensfun's normalisation and meaning:
- `ptlens`: R_d = a R_u⁴ + b R_u³ + c R_u² + (1 − a − b − c) R_u, with R = 1 at half the shorter side of the calibration frame;
- `poly5`: R_d = R_u (1 + k1 R_u² + k2 R_u⁴), same normalisation;
- `pa`: C_d = C_s (1 + k1 r² + k2 r⁴ + k3 r⁶), with r = 1 at the corner of the calibration frame.

Example: a lens from the file, with the first of its distortion and vignetting entries:

```
L	Sony	E 16mm f/2.8	Sony E	1.534	1.5
D	16	0.01701	-0.02563	-0.0052
V	16	2.8	0.25	-1.8891	1.7993	-0.7326
```

---

# Perfiles de objetivo de Rawelier (de la base de datos Lensfun)

Esta carpeta contiene los perfiles de objetivo que usa el editor de fotos Rawelier para corregir la distorsión y el viñeteo:
1.574 objetivos, 1.059 cámaras, 52 monturas, 6.500 entradas de distorsión y 19.040 de viñeteo.

Son una adaptación de la **base de datos de objetivos de Lensfun** (https://github.com/lensfun/lensfun/tree/37238fcef563196fb798f6151cb9023968b26c40/data/db), copia 37238fcef5 del 17 de noviembre de 2026, hecha por el
proyecto Lensfun y las muchas personas que le han aportado calibraciones. La base de datos de Lensfun tiene la licencia
**Creative Commons Reconocimiento-CompartirIgual 3.0** (CC BY-SA 3.0), y esta adaptación también: se puede copiar, compartir
y adaptar, también con fines comerciales, citando las fuentes y compartiendo las adaptaciones propias con la misma licencia.
Ver `LICENSE.md`.

Lensfun y sus colaboradores no respaldan Rawelier. La base de datos completa y al día, y la biblioteca que la aplica, están en
https://lensfun.github.io

El archivo `rawelier-lens-profiles.txt` es, byte a byte, la tabla que lleva la app. Qué se cambió respecto a Lensfun y el formato de cada
línea están explicados arriba, en inglés.
