Any Filter Lightroom Plugin


Any Filter provides search capabilities similar to smart collections but with many more searchable photo fields (criteria) and many more operators for comparing fields. Search over any photo field or setting that’s visible in Lightroom and many that aren’t, including IPTC Extension, GPS location, library properties, develop settings, and plugin fields (353 fields in all). Additional operators include exact text match, matching regular expressions, testing empty fields, distinguishing explicit from implicit ancestor keywords, treating text fields as numeric, and including other saved Any Filters and smart collections.

Example Any Filters include:

  • Has Virtual Copies

  • Top of stack, without keywords

  • Cropped megapixels less than 1.5 MP

  • Aspect ratio (width / height) greater than 3

  • Captured Christmas day (any year)

  • Keywords include ancestor keywords

  • Exact match of explicit keywords (not parents)

  • Exactly one person in the keywords

  • Exact text match of caption

  • Captions starting with number greater than 500

  • Within 10 kilometers of Stanford University (GPS)

  • Locations Shown in Palo Alto, CA (IPTC Extension)

  • Subject Distance less than 1 meter

  • Metering Mode is multi spot

  • Spot Removal applied

  • Develop exposure greater than 1

  • Raw camera profile not Camera Standard

 

Any Filter also provides additional commands:

  • By Date: filters by dates and date ranges without fussing with the Library Filter bar;
  • Sort: sorts photos by one or more fields and saves the photos and the fields to a text file;
  • Fix Burst Times: sets the fractional seconds of bursts of photos so they sort properly in Library.

Try it for free for 30 days. Buy a license at a price you name.

Download and Install

Any Filter requires Lightroom 3 or later.

  1. Download anyfilter.1.26.zip.

  2. If you're upgrading from a previous version of Any Filter, exit Lightroom and replace the existing anyfilter.lrplugin folder with the new one extracted from the downloaded .zip. Restart Lightroom and you're done.

    If you're upgrading from version 1.6 or earlier: Before replacing the anyfilter.lrplugin folder with the new one, copy the file anyfilters.txt out of the folder. After replacing the folder with the new version, copy that file back into the folder. This will preserve your saved Any Filters. After version 1.6, this is no longer necessary.

  3. If this is a new installation, extract the folder anyfilter.lrplugin from the downloaded .zip and move it to a location of your choice.

  4. In Lightroom, do File > Plug-in Manager.

  5. Click Add, browse and select the anyfilter.lrplugin folder, and click OK (Windows) or Add Plug-in (Mac OS).

  6. Lightroom will present a scary-looking, cryptic message: "Your catalog must be updated before it can be used with the following plugin". Click Update Catalog. This warning is harmless and is shown for plugins that store their own data in the catalog (which is many of them)—but don't worry, Lightroom ensures such plugins can't corrupt your catalog.

The free trial is for 30 days—after that, you’ll need to buy a license.

Buy a License
  1. Buy a license at a price you think is fair: Add to Cart
    The license includes unlimited upgrades. Make sure you're satisfied with the free trial before buying.

  2. Copy the license key from the confirmation page or confirmation email.

  3. Do Library > Plugin-Extras > Any Filter > Search.

  4. Click Buy.

  5. Paste the key into the License key box and click OK.

Using Any Filter > Search

Creating an Any Filter is very similar to creating a smart collection. If you’re not familiar with smart collections, I recommend you read the Adobe Help before trying to use Any Filter. Any Filter includes all the criteria of smart collections and adds many more.

Any Filter commands are available under Library > Plug-in Extras > Any Filter menu as well as File > Plug-in Extras > Any Filter. Their location under File allows them to be used in any module, while the Library menu is retained for users accustomed to earlier versions of Any Filter.

Applying a Saved Any Filter

When you apply a saved Any Filter, all the images in the catalog are filtered to show just the ones matching the Any Filter. Unlike smart collections, the results aren’t automatically updated as you change images – reapply the filter to see new results.

To apply a saved Any Filter:

  1. Do Library > Plug-in Extras > Any Filter > Search (keyboard shortcut ALT+L S S on Windows).

  2. Click Any Filters in the upper left.

  3. Select one of the saved Any Filters on the right.

  4. To search only visible photos (showing in Grid mode or in the filmstrip), rather than the entire catalog, check Visible photos only.

  5. Click Apply, or double-click the selected Any Filter.

  6. The Library Filter bar will be updated to filter all the images in your catalog that match the criteria of the selected Any Filter.

Each time you apply an Any Filter, the resulting photos are saved in a new collection under the collection set Any Filter Results. Any Filter retains the most recent 8 results. If you want to retain one of the collections permanently, rename it or move it to another collection set. You can disable saving of results by unchecking the option Save results as a collection.

To enable reasonably fast searching, Any Filter uses Lightroom's built-in search facilities wherever possible. But Lightroom has numerous obscure bugs in its search. If you suspect you're encountering such a bug, use the Avoid Lightroom bugs option. This will avoid the bugs, at the expense of much slower searching.

Applying a Collection or Smart Collection

As a convenience, you can filter using an existing collection or smart collection rather than a saved Any Filter. This lets you view the contents of a collection with all the contained stacks collapsed (Lightroom doesn’t show stacking for collections). It also lets you snapshot the contents of a smart collection, which is handy when you don’t want the set of images matched by the smart collection to automatically update as you modify them.  And it lets you intersect the results of a smart collection or collection with a folder, functionality that was removed from Lightroom 4.

  1. Do Library > Plug-in Extras > Any Filter > Search (keyboard shortcut ALT+L S S on Windows).

  2. Click Collections in the upper left.

  3. Select one of the collections or smart collections on the right.

  4. Click Apply, or double-click the selected collection.

  5. The Library Filter bar will be updated to filter just the images in the collection.

Creating and Editing an Any Filter

Creating and editing an Any Filter is similar to creating a smart collection:

  1. Do Library > Plug-in Extras > Any Filter > Search (keyboard shortcut ALT+L S S on Windows).

  2. Click an existing Any Filter or click New.

  3. Enter a name for the Any Filter.

  4. The current criteria are displayed, one per line. To edit a criterion, click on it and then use the drop-downs and edit fields to change the criterion:

  5. To add a new criterion after the currently selected one, click the "+" button; to delete a criterion, click the "-" button.

Searching Plug-in Metadata

Any Filter can search custom metadata fields defined by plug-ins. To tell Any Filter to search a plug-in’s fields:

  1. Click Plug-in Metadata.

  2. Click Add Plug-in.

  3. Browse to folder containing the plug-in and click OK.

When editing an Any Filter, the plug-in will now be listed in the left-most drop-down menu along with the other categories of criteria (Library, Date/Time, Description, etc.).

Plug-ins that store numbers in their metadata fields store the numbers as texts, but you can use Any Filter’s numeric operators (< number, = number, etc.) to treat those fields as numeric.

Any Filter Criteria

Any Filter provides all of the searchable photo fields (criteria) and operators of smart collections and many more, including IPTC Extension, GPS location, library properties, develop settings, and plugin fields. The complete list is available here. Additional operators include exact text match, matching regular expressions, testing empty fields, distinguishing explicit from implicit ancestor keywords, treating text fields as numeric, and including other saved Any Filters and smart collections.

Matches Patterns

The matches and doesn't match operators test whether a field's value matches a pattern. The pattern syntax is documented here.

Fields with Multiple Values

Any Filter provides more flexibility with fields like Collections and Keywords that contain multiple values. As with smart collections, you can define a criterion Keywords = John that matches a photo if at least one of its keywords is equal to John. But you can also define that criterion more explicitly as:

Keywords some items
    Keyword = John

which is true if at least one of the keywords is equal to John. Similarly, the criterion Keywords != John matches if none of the keywords matches John; this is equivalent to:

Keywords no items
    Keyword = John

Using this explicit testing of individual items, you can write more complicated criteria:

Keywords all items
    Some of
        Keyword = John
        Keyword = Peter

This matches a photo if all of its keywords are either John or Peter. See the predefined Any Filter Exactly one person in the keywords for how to write a more complicated filter that matches photos that contain exactly one person (a subkeyword of People) and no others.

Some of the IPTC Extension fields are actually sequences of multiple subfields. For example, the Locations Shown field can contain one or more locations, each of which has a City, Country Code, Country, Province/State, Sublocation, and World Region. To match photos showing the location Palo Alto, CA:

Locations Shown some items
    All of
        City = Palo Alto
        State/Province = CA

For any field with multiple values, you can test the number of values using the number of operators. For example, to match photos with no more than 2 explicit keywords assigned:

Explicit Keywords number of <= 2
     Include all items

To match photos with exactly 2 explicit keywords that are subkeywords of People:

Explicit Keywords number of = 2
     Keyword subkeyword of People

Explicit Keywords

Lightroom’s smart collections and filtering define the Keywords criterion to mean any keywords that have been explicitly applied to the photo, the corresponding ancestor keywords, and any synonyms of those keywords. For example, if the keyword People > Family > John has been applied to a photo, then the smart collection Keywords contains People will match that photo.

With Any Filter’s Explicit Keywords criterion, you can match the explicitly applied keywords only, ignoring synonyms and the implicit ancestor keywords. You can use the subkeyword of operator to test if an explicit keyword is a subkeyword or identical to another keyword. For example, the criterion Explicit Keywords subkeyword of People is the same as Keywords = People. See the predefined Any Filter Exactly one person in the keywords for an example.

The criterion Explicit Keywords contains ancestors has a unique purpose, to identify a photo that has both a keyword and its ancestor explicitly applied, for example, People and People > Family > John. This can be handy when you’re adding more levels of detail to your keyword hierarchy and want to find photos where you've accidentally applied both a keyword and its ancestor.

ExifTool Field

The ExifTool Field criterion (in the Description category) lets you search virtually any metadata field stored in master photos, regardless of whether that field is in the Lightroom catalog. Any Filter uses the well-regarded, authoritative, but hard-to-learn ExifTool utility to read fields from the photos.

You can enter any field name recognized by ExifTool—see its documentation for the complete list. The field name may include an optional ExifTool group prefix (required only when there are multiple fields with the same name). For example, ImageDescription, EXIF:ImageDescription, and IFD0:ImageDescription all refer to the same field.

Any Filter treats every ExifTool field as a string. If the field contains numeric values, use the "number" comparison operators. For example:

ExifTool Field > number 3 field: Rating

will search the XMP:Rating field for values numerically greater than 3.

ExifTool Field searches the metadata stored in the master photo files on disk, not in the Lightroom catalog, and it never searches the .xmp sidecar files in which Lightroom stores metadata changes for raw files. (All the fields stored in the sidecars are also in the Lightroom catalog and searchable by other Any Filter criteria.)

If you're searching a field in a non-raw file that Lightroom may have modified, you'll need to ensure that the field in the catalog has been written back to the photo files. Select all the photos and do Metadata > Save Metadata to File, or set the Lightroom option Automatically write changes into XMP in Catalog Settings > Metadata.

Compared to other Any Filter criteria, ExifTool Field is very slow, limited by the speed of the ExifTool utility. ExifTool can process about 50 photos per second, so to search a catalog with 50,000 photos would take roughly 1000 seconds (17 minutes)!

Any Filter Speed

Some Any Filters match photos as fast as smart collections, and most will match at least 1500 photos/second,  often many times faster. But if they access develop settings, they could match as slow as 250 photos/second, and if they use ExifTool Field, as slow as 20 photos/second. Any Filter is limited by the speed at which Lightroom supplies plug-ins with photos’ metadata.

Wherever possible, Any Filter uses smart collections internally to speed up matching. For example, to implement Keywords = John, Any Filter first executes Keywords contains John using smart collections (which is very fast) and then further filters the resulting photos to those whose keywords exactly match John.

If your Any Filter is matching too slowly, consider adding smart-collection criteria that will help Any Filter quickly narrow down the set of photos. For example, if you know that the desired photos were captured in the last several months, add a Date/Time Original (Capture) criterion.

Using Any Filter > By Date

The By Date command lets you quickly filter by dates and date ranges by typing the dates, rather than fussing with the Library Filter bar. When prompted for a date, you can enter the full year/month/day, year/month, or just a year:

For example, to find all photos in 2012, select Date and enter 2012. To find all photos from 1993 to 1999, select Date Range and enter the years 1993 and 1999.

The option Clear current filter clears all previous filter conditions in the Library Filter bar; deselecting that option causes a Date column to be added to the current filter.

Using Any Filter > Sort

The Sort command sorts the selected photos by one or more fields (any of the fields available to Search) and optionally exports the photos and fields to a text file:

You can sort a field in ascending or descending order, and you can force a field to be sorted alphebetically or numerically. (As of Lightroom 2015.10 / 6.10, that option doesn't have any effect due to a Lightroom bug.)

If you select the option Save sorted list to collection, the sorted list will be saved in the collection Any Filter Sorted. Be sure to do View > Sort > Custom Order to view the collection in the chosen order.

If you select the option Save sorted list and fields to CSV file, the list of photos and the chosen fields will be saved in the designated text file in comma-separated values format. You can open the file in Excel, Google Sheets, or any other application that understands CSV format.

Sort adds a URL column to the file containing lightroom: URLs. In Excel, use the HYPERTEXT function with this column to make clickable links that will take you directly to each photo in Lightroom.

Using Any Filter > Fix Burst Times

Many cameras don't set the capture time's fractional seconds of bursts when shooting in drive mode, and the bursts often appear out of order in Library. The Fix Burst Times command finds bursts of photos having the same capture time and sets the photos' fractional seconds to be increasing in the same order as their filenames, e.g. to .0001, .0002, .0003, etc. This properly orders the bursts in Library when sorting by capture time. 

Clicking Save Bursts saves each burst of photos as a collection inside the collection set Any Filter Bursts, letting you preview the bursts before setting their fractional seconds.

We wouldn't need Fix Burst Times if Lightroom simply sorted by filename when photos' capture times were equal—please add your me-too vote to this feature request.

Keyboard Shortcuts

Windows: You can use the standard menu keystrokes to invoke Any Filter commands. For example, ALT+L opens the Library menu, U opens the Plug-in Extras submenu, and S invokes the Any Filter Search command.

To reassign a different final keystroke to an Any Filter menu item, edit the file Info.lua in the plugin folder. Move the & in front of the desired letter in the menu command’s name, changing the name itself if necessary.

Mac OS: You can use the standard mechanism for assigning application shortcuts to plugin menu commands. In System Preferences > Keyboard > Keyboard Shortcuts > Application Shortcuts, select Adobe Lightroom. Click "+" to add a new shortcut, in Menu Title type the name of the menu command preceded by three spaces. For example, if you wanted to assign a key to the Any Filter > Search command, type "<space><space><space>Search". In Keyboard Shortcut type the desired key or key combination.

Support

Please send problems, bugs, suggestions, and feedback to:

I’ll gladly provide free licenses in exchange for reports of new, reproducible bugs.

If Any Filter crashes with an error or produces surprising results, please check the Debug option and re-apply the filter. In the plug-in folder anyfilter.lrplugin, find the files debug.log and anyfilters.txt and email them to me. If you don’t remember the location of the folder, do File > Plug-in Manager, select Any Filter, and look at Path. On Mac OS, the folder won’t normally open in the Finder – right-click it and select Show Package Contents.

Known limitations and issues:

  • Any Filter requires Lightroom 3 or later – it relies on features missing from earlier versions.

  • Any Filter can sometimes match photos as slow as 270 photos/second (the develop settings, in particular). See Any Filter Speed for tips on speeding up filters.

  • If you're confused as to why a photo does or does not match an Any Filter, use the Sort command to write the criteria values of the selected photos to a CSV file and open the file in Excel or Google Sheets.

  • The Any Filter: Search column in the Library Filter Bar Metadata browser is not intended to be used directly by users. Rather, Any Filter uses it to display the results of applying a filter quickly. Ideally, it would be hidden from users, but Lightroom doesn't make that possible.

  • If you try to use criteria not supported by your version of Lightroom, you'll get an inelegant plugin error. For example, if you try to use the Lightroom 5 criterion Has Smart Preview in Lightroom 4 or earlier, you'll get an error.

  • Due to a Lightroom bug, Any Filter cannot always search correctly the location fields (ISO Country Code, Country, State / Province, City, Sublocation) when their values have been automatically added by Lightroom's address mapping (reverse geo-encoding). Such values appear gray in the Metadata panel. You can work around this by committing these gray values: Click on the field label (e.g. Country) and select the value, changing the field from gray to white. Or use the Commit Locations command of the Any Tag plugin.

  • Any Filter tries to work around a number of bugs in Lightroom’s smart collections and filtering, which is creaky and needs significant improvement (one of my motivations for making Any Filter). I fully expect that there are undiscovered Lightroom bugs that Any Filter’s users will trip over. If you suspect such a bug, see above for how to report them.

Version History

1.4
  • Initial release
1.5
  • Fixed Lens Profile Name to be a text field, not a number
1.6
  • Added number of operators for fields with multiple values
1.7
  • Added By Date command.
  • The Distance From, Latitude, and Longitude criteria now accept either form of coordinate, -118.5469 or 118° 32' 49" W.
  • Saved Any Filters are now stored in the Lightroom preferences folder, making it easier to upgrade to new versions of Any Filter.
  • Distance From, Latitude, and Longitude criteria execute much faster.
1.8
  • Fixed incompatibility with user names containing non-ASCII characters (caused by bug in Lightroom SDK).
1.9
  • Allowed .lrplugin directories to be selected by the Plug-in Metadata > Add Plug-in command on Mac.
1.10
  • Added new fields for LR 4, including Process Version 2012 develop settings.
  • Any Filter commands now appear on both the File > Plug-in Extras and Library > Plug-in Extras menus, so they can be used in all modules, not just the Library.
  • Added Visible photos only option for searching just the visible photos.
  • Added the field Saved Locations for searching photos located within a saved map location.
  • Provided a documentation link above for matches patterns.
  • The Scene field is renamed to IPTC Scene Code.
  • The Location field is renamed to Sublocation and mapped to the correct metadata field (no longer to "scene").
  • Now ignores errors from corrupted catalog entries.
  • Fixed a bug with Apply of collections.
  • More gracefully handles syntactically ill-formed captures in matches regular expressions.
  • In LR 4, uses the SDK's new backoff feature for handling updates to the catalog.
1.11
  • New field Metadata Status (not available in Lightroom 3).
  • New field Crop Constrain To Warp.
  • Fixed "assertion failed" when you search with Visible photos only and no photos are visible.
  • Fixed error when Visible photos Only and Debug are both selected.
  • Correctly handles Subject Distance and Video Frame Rate in countries in which the decimal mark is comma rather than dot.
1.12
  • New field Collection Sets, similar to Collections.
  • New field Associated File Types tests whether there are associated files with the same base name but different extensions (for example, xmp).
1.13
  • New fields Incremental Temperature and Incremental Tint, representing Temp and Tint for JPEGs in the Develop module.
  • Fixed typo in field Incremental Lights.
1.14
  • New fields Temperature and Tint, representing Temp and Tint for raw files in the Develop module.
1.15
  • Fixed Aspect Ratio when used in some compound queries.
1.16
This version includes lots of changes to better support Lightroom 5, along with other miscellaneous changes:
  • Added 20 new fields provided by Lightroom 5: Color Noise Reduction Smoothness, Enable Circular Gradient Based Corrections, Circular Gradient Based Corrections, Perspective Aspect, Perspective Upright, Lens Profile Filename, Crop Constrain Aspect Ratio, Has Smart Preview, Smart Preview Path, Smart Preview Size, Is DNG With Fast Load Data, Is Proof, Long Edge, Short Edge, Cropped Long Edge, Cropped Short Edge, Cropped Megapixels, Bits Per Channel, Source Color Mode, Source Color Profile.
  • Significantly speeded up these fields using new features in Lightroom 5: Width, Height, Cropped Width, Cropped Height, Megapixels, Cropped Megapixels.
  • The fields Megapixels and Cropped Megapixels are rounded to the nearest tenth, to conform with Lightroom 5 smart collections.
  • Added is unknown operator for dates/times, making it easier to test for images missing the metadata field Date Time Original.
  • Made the user interface a little easier to read on Windows, working around a Lightroom 5 bug that Adobe is unlikely to fix anytime soon.
  • Made Any Filter robust in the face of invalid dates/times stored in catalogs converted from early versions of Lightroom. In particular, the "month" and "day in month" date operators won't fail with such catalogs.
  • Changed the option Log matching metadata to Log photo metadata, which logs metadata of all the photos, not just those matching the searching criteria.
1.17
  • New option Save results as a collection saves Any Filter results in collections under the collection set Any Filter Results.
  • Worked around many bugs in Lightroom smart collections and metadata, most of which were obscure edge cases that most users would never encounter.
1.18
  • New field IPTC Date Created.
1.19
  • Worked around Lightroom SDK bugs with the fields Tone Curve Point Adjustments, Filename, and Copy Name.
  • Fixed a bug with the field Spot Removal that caused click-and-drag clones from being recognized.
1.20
  • Keywords criterion now searches keyword synonyms too.
  • Clear current filter option lets you keep current filter settings in the Library Filter bar.
  • New fields Metadata Date, Location Is Private, Audio Channel Type, Audio Sample Rate, Audio Sample Type, Track Number, Video Alpha Mode
  • Fixed bug in Copyright Status.
1.21
  • Fixed typo in criterion Luminance Adjustment Aqua.
  • Improved wording of Clear current Library filter.
1.22
  • Added Dehaze develop setting.
  • Worked around Lightroom bugs with Max Available Height and Width, Last Edit Time.
1.23
  • Added Location > Image Direction criterion (GPS image direction).
  • Worked around Lightroom bug with Published Via criterion.
  • Added mirrored orientations to Orientation and made it much faster.
1.24
  • Worked around Lightroom bug that sometimes prevented By Date from properly setting the date filter.
  • Worked around Lightroom bug that broke the day in week operators.
  • Case is now always significant when using the matches operator to match patterns. Previously sometimes case was ignored, sometimes it wasn't.
1.25
  • New criterion ExifTool Field for searching any metadata field stored in master photos.
  • New criterion Published Collection Sets.
  • New criteria Exposure Value and Effective Exposure Value for searching by the total exposure, an estimate of the amount of available light.
  • New criteria for Develop's Upright Transform: EnableTransform, PerspectiveX, PerspectiveY, UprightFourSegmentsCount, UprightTransformCount, UprightVersion, AutoWhiteVersion.
  • Fixed bug with Distance From Google URL.
1.26
  • Sort command for sorting photos and exporting fields to text files.
  • Fix Burst Times command for setting fractional seconds of drive-mode bursts.
  • New criterion Snapshots.
  • Ability to filter for multiple values meeting specific criteria, e.g. the number of explicit keywords that are subkeywords of People.
  • Removed the option Log photo metadata; use the Sort command instead.
  • New option Avoid Lightroom bugs for avoiding obscure Lightroom search bugs, at the expense of searching much more slowly.
  • ExifTool Field now allows is empty and isn't empty.
  • ExifTool Field now allows unknown tags (ExifTool's -u option).
Copyright 2011-17 John R. Ellis