# The automatic profile loader

Noise Ninja includes an automatic profile loader that selects the "best" noise profile when you open an image. It depends on profile annotations. When it is set up correctly, it works almost transparently. However, it is recommended that you read through this entire section to be aware of some of the requirements and idiosyncrasies of the auto loader.

The auto-profiler can be enabled, disabled, and configured via options in the Profiles page of the Preferences dialog.

In a nutshell, here's how the automatic loader works:

1. The image is scanned for embedded EXIF data like Manufacturer, Model, ISO, sharpness, and about a dozen other attributes.
2. Attributes which are not obtained from the EXIF data are optionally filled in using default values supplied by the user (see below).
3. Given EXIF Manufacturer and Model values of <manufacturer> and <model>, respectively, the automatic loader looks in the Noise Ninja installation directory for a folder named NoiseProfiles/<manufacturer>/<model>. For instance, if the Manufacturer is "Canon" and the Model is "CanonEOS-1Ds", the automatic loader will look for a folder named "NoiseProfiles/Canon/CanonEOS-1Ds/" within the Noise Ninja installation directory.
4. If the folder exists, the automatic loader scans all profiles in the folder and all child folders, and it reads the annotation data for each profile. It identifies the profile with annotations that best match the attributes of the image. This profile is loaded automatically, and the title bar of the main window will display "Matched <profile>", where <profile> is the name of the loaded profile. All the scanned profile annotations are cached, so next time the same camera model is needed, they won't be loaded from disk again.
5. If the folder does not exist or if the matching process fails for some reason, the automatic loader will reuse the last profile that was loaded. In this case, the title bar will display "Using previous". This "previous profile" is remembered across invocations of Noise Ninja.

## How attributes are weighted

During the matching process, the Maker, Model, ISO, and Megapixels attributes normally carry the most weight. For film scans, the Film and Multisampling fields also carry high weight. Sharpness, saturation, and contrast have medium influence. The remaining fields normally have low influence, though it depends on the specific profile set and the magnitude of differences between values. See the discussion about "How many profiles do I need?".

## Required and optional attributes

Matching will fail if the Maker, Model, or ISO are undefined either in the image attributes (after default substitution) or in the profile annotations. Other attributes or annotations are optional, though missing values may cause a profile to earn a lower ranking during matching.

## Guidelines for using the profile loader

Once it is set up correctly, the automatic profiler can be very effective and convenient. To ensure that it works as expected, you should adhere to the following guidelines:

- In the Preferences dialog, make sure the you have checked the options for automatically creating profile directories, and for enabling the automatic profiler.
- If you download profiles from PictureCode or some other source, use the "Install noise profiles" function in the "File" menu to copy the profiles to the correct folder. The "Install noise profiles" function reads the Manufacturer and Model annotations in each profile and ensures that the profile is copied to the correct subdirectory in the NoiseProfiles folder.
- Make sure you have both read and write permission for the NoiseProfiles folder.
- When you annotate the Manufacturer and Model fields for a profile, try to use the Auto Fill button in the annotation dialog to initialize the fields directly from the image EXIF data. This will minimize the chance of typographical mistakes or other errors that might prevent the automatic loader from matching a profile to a camera.
- Use the "Set Match Criteria" dialog to modify the way in which profiles are selected:
  This can be useful when you want to limit matching to a particular set of profiles, or when you want to work with cropped images or reduced-resolution images. Click here for more information.
- Look in the title bar to see whether the auto-loader succeeded. You will see "Auto matched" and the profile name in the title bar after a successful match. "Using Previous" means the match failed and the previous profile is being used. "New profile" means there was no previous profile, or the profile has been cleared.

## Keep it simple

In general, try not to make the matching process too difficult for the auto-loader. It has to optimize within a 15-dimensional space, and that is not always an easy thing to do. The auto-loader tries to make intelligent choices when there is not an obvious match, but this can lead to some non-intuitive results. For instance, if you only have profiles for 6 megapixel images, and you use the auto loader for a 3 megapixel ISO 1600 image, the auto loader might pick an ISO 800 profile. This is because the downsampling process used to create a 3-megapixel image from a 6-megapixel sensor also reduces noise levels. There are a number of relationships like this that the auto-loader attempts to consider. However, these relationships are most reliable when they do not involve large differences in parameter values.

So, to increase the reliability of the matching process, and to make it less likely that you will be confused by the automatic selections, try to use or create profile sets that are already well matched to your shooting preferences.

## Working with crops and reduced-size images

It is recommended that you work with full-size images instead of crops. This will avoid potential ambiguity in the profile matching process.

By default, Noise Ninja assumes that the dimensions of the image denote the full resolution, not a crop. It attempts to match this value against the Megapixels annotations of existing profiles. For instance, if you have profiles for both 3 megapixel images and 6 megapixel images from the same camera, then Noise Ninja will match a 3 megapixel image against the 3 megapixel profiles.

Downsampling reduces noise levels, but cropping does not change noise characteristics. So, if you try to filter a 3 megapixel crop from a 6 megapixel original image, Noise Ninja will match the wrong set of profiles.

One way to avoid this problem with crops is to set the Megapixels field in the Set Match Criteria dialog:

If you set the Megapixel field in the Match Criteria dialog, then Noise Ninja will assume that this is the uncropped size of all images that you try to filter. So, it will try to select profiles for this size even if you open a cropped image. If you are working with reduced-resolution images, however, you should leave the Megapixels field set to the default setting of "---".

If you work with reduced-resolution images, it is best to create profiles specifically for that resolution. Otherwise, Noise Ninja will select a higher-resolution profile, but it will try to select a lower ISO to compensate for the reduced noise in the downsampled image. For instance, if you have profiles for 6 megapixel images and then you open a 3 megapixel ISO 400 image, Noise Ninja might select a 6 megapixel, ISO 200 profile. This is probably a better choice than the 6-megapixel ISO 400 profile, but it might not be as good as a profile created specifically for 3-megapixel ISO 400 images.

## Other comments (and a note for Sony camera owners)

Regional variations in EXIF data: Realize that the Model field for some cameras varies in different regions of the world. For instance, if you are using a camera bought in Asia with profiles created using the American version of the same camera, you might need to change the Model annotations in the profiles and re-save them (with the automatic directory naming function enabled).

Sony camera owners: Several Sony cameras use the same name -- "Cybershot" -- for the EXIF Model field. If you use one of these cameras, then you will need to go to the NoiseProfiles/Sony/Cybershot/ directory and move the profiles for other models to another directory.

Automatic profile naming: In the Preferences dialog there is an option to automatically name profiles, using a mnemonic scheme derived from the annotation values. This feature is not necessary to use the auto loader. The auto loader ignores the actual profile names. Instead, it looks at the annotations that are stored inside the profile. The automatic naming scheme may make it easier to distinguish different sets of profiles for the same camera. However, if you prefer another naming scheme, feel free to use it.

Proprietary or missing ISO data: Some cameras store ISO and other information in a proprietary, undocumented EXIF field called the MakerNote. Noise Ninja can read some MakerNote fields, but not for all cameras. Usually, it can find enough information to make a match. However, two things in particular can interfere. First, ISO information is sometimes removed by other software applications when it is stored in the MakerNote field. Second, the "Auto ISO" mode available on some cameras might not store the actual ISO used for an image in a place where Noise Ninja can read it.