From patchwork Thu Jan 8 09:20:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 25689 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 9B09DBE08B for ; Thu, 8 Jan 2026 09:20:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A45A261FC1; Thu, 8 Jan 2026 10:20:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="bBNE3xp4"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D3B3761A35 for ; Thu, 8 Jan 2026 10:20:34 +0100 (CET) Received: from neptunite.hamster-moth.ts.net (unknown [IPv6:2404:7a81:160:2100:8074:4b5f:f9b1:ac84]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5C6A356D; Thu, 8 Jan 2026 10:20:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1767864012; bh=j9+PCs2cDpQ0ayvBFFykXjUsSb0mEvL5S4K7H4FFJ0Y=; h=From:To:Cc:Subject:Date:From; b=bBNE3xp4RpGlGKELwNV04j+rdb4BeJ4LMDHqeSROUdH4dyHOiZ/4hyOJ75CIX4iy+ 7+HDHQTnp5lvW1bztQ394V+rIRvFxsDG2jSxhGm2QW9CeIOD3kVD7pb3dDFux1geqG dfQj+KtOT50BMDY3YqS6mYPWcqfvR5fRVRTCL5Ck= From: Paul Elder To: libcamera-devel@lists.libcamera.org Cc: Paul Elder Subject: [PATCH] camshark: image: Fix data storage of 8-bit raw Date: Thu, 8 Jan 2026 18:20:22 +0900 Message-ID: <20260108092022.1190351-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.47.2 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The image data in the Image class is reshaped to numpy arrays to ease processing. However, for 8-bit raws, this was converted to uint16 which is not correct. Fix this by changing the numpy array storage type to uint8 for 8-bit raw formats. Signed-off-by: Paul Elder --- src/camshark/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/camshark/image.py b/src/camshark/image.py index 9f7e2408eb70..a167b98530bb 100644 --- a/src/camshark/image.py +++ b/src/camshark/image.py @@ -48,7 +48,7 @@ class Image: if self.bitspp == 8: data = data.reshape((height, width)) - data = data.astype(np.uint16) + data = data.astype(np.uint8) elif self.bitspp in [10, 12, 14, 16]: pixel_stride = stride // 2 data = data.view(np.uint16)