Improve the mosaic algorithm further #43

Merged
Roflin merged 4 commits from improve-mosaic into master 2023-12-21 16:34:27 +01:00
Showing only changes of commit 321e2587b5 - Show all commits

View File

@ -220,6 +220,10 @@ class PhotoMosaic
{ {
$score = $this->getScoreForRow($imageSelection, $requiredImageTypes); $score = $this->getScoreForRow($imageSelection, $requiredImageTypes);
$fitnessScores[$layout] = [$score, $imageSelection]; $fitnessScores[$layout] = [$score, $imageSelection];
// Perfect score? Bail out early
if ($score === count($requiredImageTypes))
break;
} }
} }