fix(immersive): increase crop sample size for more relevant colors

Zoom factor changed from 1.5-3x to 1.1-1.6x
Now samples 62-90% of image instead of 33-66%
This commit is contained in:
vicrodh committed 2026-02-01 11:34:36 -06:00
1 parent 0bdd83dc08
commit 8917049b00
2 files changed
+4 -4

No files matched your search

@@ -99,8 +99,8 @@
const cropCtx = cropCanvas.getContext('2d');
if (!cropCtx) { isLoading = false; return; }
// Zoom factor: 1.5x to 3x
const zoomFactor = 1.5 + rand() * 1.5;
// Zoom factor: 1.1x to 1.6x (takes 62%-90% of image for more relevant colors)
const zoomFactor = 1.1 + rand() * 0.5;
const sourceSize = Math.min(img.width, img.height) / zoomFactor;
const maxOffset = Math.min(img.width, img.height) - sourceSize;
+2 -2
View File
@@ -60,8 +60,8 @@ function extractRandomCrop(
const rand = seededRandom(seed);
// Zoom factor: 1.5x to 3x (we take 33%-66% of the image)
const zoomFactor = 1.5 + rand() * 1.5;
// Zoom factor: 1.1x to 1.6x (we take 62%-90% of the image for more relevant colors)
const zoomFactor = 1.1 + rand() * 0.5;
// Source region size (what portion of original image to take)
const sourceSize = Math.min(img.width, img.height) / zoomFactor;