Resource

Resource Basics

Resource Name Select Similar Images In Collection
Resource Version 1.0
Category Thumbnail Selections
Downloads 566
Release Date 3/4/2025 2:16:47 PM
 

Resource Details

Description This script allows you to find all similar images inside the active collection.
The similar images will be marked.
Installation Instructions na
Usage Instructions 1. Select the thumbs for which to select similar images
2. Right click on the thumb
3. Select Run Script from Repository
4. Select Thumbnail Selections
5. Select this script
Changes in this version na
Special Requirements
 

Author Information

Author Name IDimager Support
 

Script


  procedure HandleImage(AImage: TImageItem; ASelectGUIDs: TStringList);
  var
    AImg: TImageItem;
    i: Integer;
  begin
    for i := 0 to ActiveCollection.Items.Count - 1 do
    begin
      AImg := ActiveCollection.Items.Items[i];
      if AImg._SimilarityCode = AImage._SimilarityCode then
      begin
        ASelectGUIDs.Add(AImg.GUID);
      end;
    end;
  end;

var
  AGUIDList: TStringList;
  i: Integer;
begin
  if Selected.Count < 1 then
  begin
    Say('Please select at least one thumbnail to find similar images for.');
    exit;
  end;

  AGUIDList := TStringList.Create;

  for i := 0 to Selected.Count - 1 do
    HandleImage(Selected.Items[i], AGUIDList);

  if AGUIDList.Count > 0 then
    PublicBroadcastText(nil, 'SelectItemsByGUIDList', AGUIDList.CommaText);
  AGUIDList.Free;
end;