Skip to content

Commit

Permalink
fix rgb mask recoloring bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sashankaryal committed Dec 13, 2024
1 parent e48511d commit d83c00a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/packages/looker/src/worker/painter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,14 @@ export const PainterFactory = (requestColor) => ({

const isRgbMaskTargets_ = isRgbMaskTargets(maskTargets);

if (maskData.channels > 2) {
// we have an additional guard for targets length = new image buffer byte length
// because we reduce the RGBA mask into a grayscale mask in first load for
// performance reasons
// For subsequent mask updates, the maskData.buffer is already a single channel
if (
maskData.channels === 4 &&
targets.length === label.mask.image.byteLength
) {
for (let i = 0; i < overlay.length; i++) {
const [r, g, b] = getRgbFromMaskData(targets, maskData.channels, i);

Expand Down

0 comments on commit d83c00a

Please sign in to comment.