From d45c9490c0399144413be61cbabc2d16d601cad4 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Fri, 19 Jun 2026 11:28:42 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20curseur=20tol=C3=A9rance=20verre=20pour?= =?UTF-8?q?=20r=C3=A9cup=C3=A9rer=20les=20zones=20semi-transparentes=20du?= =?UTF-8?q?=20d=C3=A9tourage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajoute alphaThreshold (défaut 30) — les pixels dont l'alpha dépasse ce seuil sont rendus opaques avant la composition sur fond blanc, évitant que le verre ou les surfaces translucides soient supprimés par le modèle IA. Co-Authored-By: Claude Sonnet 4.6 --- src/app/(dashboard)/images/page.tsx | 3 ++- src/components/images/ImageCard.tsx | 17 ++++++++++++++- src/hooks/useImages.ts | 33 +++++++++++++++++++---------- src/lib/client/bgRemover.ts | 13 +++++++++++- src/types/images.ts | 1 + 5 files changed, 53 insertions(+), 14 deletions(-) diff --git a/src/app/(dashboard)/images/page.tsx b/src/app/(dashboard)/images/page.tsx index 5e3000c..4e4b8c6 100644 --- a/src/app/(dashboard)/images/page.tsx +++ b/src/app/(dashboard)/images/page.tsx @@ -10,7 +10,7 @@ import { useImages } from '@/hooks/useImages' import type { ImageItem } from '@/types/images' function ImagesPageInner() { - const { items, addFiles, setFeather, rotate, uploadOne, uploadAll, removeItem, assignProduct } = useImages() + const { items, addFiles, setFeather, setAlphaThreshold, rotate, uploadOne, uploadAll, removeItem, assignProduct } = useImages() const [lightboxItem, setLightboxItem] = useState(null) return ( @@ -38,6 +38,7 @@ function ImagesPageInner() { key={item.id} item={item} onFeatherChange={setFeather} + onAlphaThresholdChange={setAlphaThreshold} onRotate={rotate} onUpload={uploadOne} onRemove={removeItem} diff --git a/src/components/images/ImageCard.tsx b/src/components/images/ImageCard.tsx index 1229b9a..bc5f639 100644 --- a/src/components/images/ImageCard.tsx +++ b/src/components/images/ImageCard.tsx @@ -5,6 +5,7 @@ import type { ImageItem } from '@/types/images' interface ImageCardProps { item: ImageItem onFeatherChange: (id: string, value: number) => void + onAlphaThresholdChange: (id: string, value: number) => void onRotate: (id: string, direction: 'cw' | 'ccw') => void onUpload: (id: string) => void onRemove: (id: string) => void @@ -94,6 +95,7 @@ function ProductSearch({ itemId, onAssign }: { itemId: string; onAssign: (id: st export function ImageCard({ item, onFeatherChange, + onAlphaThresholdChange, onRotate, onUpload, onRemove, @@ -148,7 +150,7 @@ export function ImageCard({ )} - {/* Contrôles feather + rotation */} + {/* Contrôles feather + tolérance + rotation */}