!7 module CachedTilesToBuckets > DynPrintLogAndEnabled { transient int tileWidth = 16, tileHeight = 16; transient new ImageBuckets buckets; start { thread "Calc" { calc(); } } void calc enter { for (File f : listImageFiles(imageSnippetsCacheDir())) pcall { if (!licensed()) ret; if (!enabled) continue with sleepSeconds(1); RGBImage rgb = loadImage(f); L tiles = rgbImageToFixedSizeTiles(rgb, tileWidth, tileHeight); for (RGBImage tile : tiles) buckets.addImage(tile); print("Buckets: " + l(buckets.buckets) + ", images: " + buckets.images + ", duplicates: " + buckets.totalDuplicates); } } }