* At least one frameline or gridline specification\r
\r
### Examples:\r
-`python createoverlay.py Z6III --frameline 16:9`\r
+`python createoverlay.py Z6III --frameline 16:9` \r
Creates a 16:9 frameline with default line and fill characteristics for a Nikon Z6 III as a PNG file, then converts the PNG to a NIkon Z6 III NEF raw. The resulting PNG is opened in your system's default image viewer.\r
\r
\r
\r
-`python createoverlay.py Z6III --gridline 4x4`\r
+`python createoverlay.py Z6III --gridline 4x4` \r
Creates a 4x4 gridline with default line and fill characteristics for a Nikon Z6 III.\r
\r
\r
-`python createoverlay.py Z6III --frameline 16:9 --frameline 1:1,dashedline=50-50,linecolor=#ff0000`\r
+`python createoverlay.py Z6III --frameline 16:9 --frameline 1:1,dashedline=50-50,linecolor=#ff0000` \r
Creates a 16:9 solid-line white frameline and a 1:1 dashed red frameline.\r
\r
\r
`<output filename>`\r
You can explicitly specify the output filename by providing an additional argument. It can include an optional path as well. If any part of the path or filename has spaces you must enclose the entire text in double quotes. Example:\r
\r
-`createoverlay Z6III --frameline 16:9 "c:\My Documents\MyGrid.PNG"`\r
+`createoverlay Z6III --frameline 16:9 "c:\My Documents\MyGrid.PNG"` \r
\r
### `--outputdir <path>`\r
Directory to store the generated overlay into. If this is specified without an `<output filename>` then createoverlay will generate the output filename automatically and store it in the `--outputdir` path.\r
\r
The `aspectratio` parameter is required - all others are optional. Any parameter not specified will use the default for that setting, which can be set separately via that option name outside of a `--frameline`. For example:\r
\r
-`--frameline 4:3 --frameline 16:9,linecolor=#ff0000 --linecolor=#0000ff`\r
+`--frameline 4:3 --frameline 16:9,linecolor=#ff0000 --linecolor=#0000ff` \r
Creates a 4:3 frameline using all default values; the default `linecolor` was specified as blue, so the 4:3 frameline will be blue. A 16:9 frameline is also created with a line color of red since that color was specified for that frameline. \r
\r
You can optionally leave out the parameter name and just provide the values instead. Use an empty field to skip a value. For example:\r
\r
-`--frameline 1:1,16,5-10,,,center-left`\r
+`--frameline 1:1,16,5-10,,,center-left` \r
Creates a 1:1 frameline with a line width of 16 pixels, dash pattern of 5 pixels with 10 pixel gaps, default line and fill colors (empty fields), and an aspect ratio label position vertically centered on the left side of the frame.\r
\r
### `--gridline griddimensions=columns x rows, aspectratio=columns:rows, linewidth=#pixels,dashedline=dashlen-gaplen, linecolor=#RRGGBB`\r
\r
You can optionally leave out the parameter name and just provide the values instead. Use an empty field to skip a value. For example:\r
\r
-`--gridline 4x4,,16,,#ff0000`\r
+`--gridline 4x4,,16,,#ff0000` \r
Creates a 4:4 grid with default aspect ratio (3:2), a line width of 16 pixels, no dash pattern (solid line by default), and line color of red.\r
\r
### `--linewidth #pixels`\r
### `--dimensions raw columns x rows, jpg columns x rows`\r
Normally the raw and jpg dimensions are established by the camera model specified. You can override those dimensions with this option, or provide them when no model is specified. Example:\r
\r
-`--dimensions 6048x4032,6000x4000`\r
+`--dimensions 6048x4032,6000x4000` \r
\r
### `--imagetype extension`\r
Determines the image format of the generated overlay, specified via the file extension of the format. Default is PNG.\r
## Specifying options in separate file, including default options\r
In addition to supplying options on the command line, you can also place additional options in a text file and supply its filename by placing a `!` before it. For example:\r
\r
-`createoverlay !myoptions.txt --generatenef no`\r
+`createoverlay !myoptions.txt --generatenef no` \r
\r
In the text file each option must be on a separate line, and any values for the option must be connected via an equal sign instead of space, otherwise the value will be interpreted as a different option. Example `myoptions.txt`\r
```\r
## Installation\r
Download img2nef by [clicking here](https://github.com/horshack-dpreview/img2nef/archive/refs/heads/main.zip) and unzip into a directory of your choice, or if you have git:\r
\r
- `git clone https://github.com/horshack-dpreview/img2nef.git`\r
+ `git clone https://github.com/horshack-dpreview/img2nef.git` \r
\r
## Running\r
Depending on your platform, img2nef can be started in one of the following ways:\r
* python3 img2nef.py\r
* imgn2ef.py\r
\r
-## Quick StartBasic parameters\r
+## Quick Start\r
+\r
+### Basic parameters\r
img2nef has many options but there are only two basic parameters are required:\r
* Nikon Camera Model (or Template NEF)\r
* Source Image File\r
\r
### Examples:\r
-`python img2nef.py Z6III sunset.jpg`\r
+`python img2nef.py Z6III sunset.jpg` \r
Converts the image sunset.jpg into a Nikon Z6 III raw, using the built-in template NEF for the Z6 III.\r
\r
-`python imgn2nef.py IMG_0085.NEF sunset.jpg`\r
+`python imgn2nef.py IMG_0085.NEF sunset.jpg` \r
Converts the image `sunset.jpg` into a Nikon raw, using the supplied template NEF. The model for the generated raw will match the model `IMG_0085.NEF` was shot with.\r
\r
img2nef also supports Numpy (.npy) file sources. See [Numpy Sources](#numpy-sources) for details.\r
When no output filename was specified img2nef will automatically generate one, which by default is the concatenation of the model/template NEF and source file names. For the first example this will be `Z6III_sunset.NEF`, stored in the same directory as `sunset.jpg`\r
\r
## More output options\r
-`<output filename>`\r
+`<output filename>` \r
You can explicitly specify the output filename by providing a third argument. It can include an optional path as well. If any part of the path or filename has spaces you must enclose the entire text in double quotes. Example:\r
\r
-`img2nef Z6III sunset.jpg "c:\My Documents\sunset.NEF"`\r
+`img2nef Z6III sunset.jpg "c:\My Documents\sunset.NEF"` \r
\r
### `--outputdir <path>`\r
Directory to store the generated NEF into. If this is specified without an `<output filename>` then img2nef will generate the output filename automatically and store it in the `--outputdir` path.\r
\r
Example:\r
\r
-`img2nef Z6III sunset.jpg --outputdir c:\docs --outputfilenamemethod INPUTFILE`\r
+`img2nef Z6III sunset.jpg --outputdir c:\docs --outputfilenamemethod INPUTFILE` \r
\r
Converts sunset.jpg, storing result to `c:\docs\sunset.NEF`\r
\r
\r
Since img2nef goes in the opposite direction, ie from a rendered image back to raw data, it has to apply the inverse of these multipliers, to simulate the lower sensitivity of the red and blue pixels. Normally img2nef uses the WB multipliers in the template NEF, which were shot with a "sunny" WB to handle normal white-balanced source images. The `--src..wbmultipliers` lets you specify a different set of WB multipliers to inversely apply. All values are in floating-point. Example:\r
\r
-`--src.wbmultipliers=1.3568,1.72325`\r
+`--src.wbmultipliers=1.3568,1.72325` \r
Applies a 1/3.3568 multiplier to the red pixels and 1/1.72325 multiplier to the blue pixels.\r
\r
### `--src.hsl H,S,L`\r
## Specifying options in separate file, including default options\r
In addition to supplying options on the command line, you can also place additional options in a text file and supply its filename by placing a `!` before it. For example:\r
\r
-`img2nef !myoptions.txt --src.grayscale`\r
+`img2nef !myoptions.txt --src.grayscale` \r
\r
In the text file each option must be on a separate line, and any values for the option must be connected via an equal sign instead of space, otherwise the value will be interpreted as a different option. Example `myoptions.txt`\r
```\r
### C-optimized NEF encoder\r
img2nef is written primarily in Python, with the NEF encoder logic written in C for performance. A pre-compiled version of the encoder is included in the Windows, Mac, and Linux directories, each of which is automatically loaded based on the detected platform. Before loading the platform-specific library img2nef will first check for the library in its base directory - this allows you to compile/use the NEF encoding module for non-standard platforms as well. The encoder module should compile without modification on any platform - it's coded to work with various native integer sizes and on both small and big endian configurations. You can compile the module via the following gcc invocation:\r
\r
-`gcc -shared -O2 -o nefencode.so nefencode.c -fPIC`ult is an NEF that's identical to the template NEF but with the raw data and embedded jpgs replaced (embedded jpgs are used by image viewers to preview the raw data without having to develop it first, including the in-camera playback functionality). The template NEF is never modified.\r
+`gcc -shared -O2 -o nefencode.so nefencode.c -fPIC` \r