Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'mrab': 0.05; 'scaling': 0.05; 'bits': 0.07; 'linear': 0.07; 'space.': 0.07; 'subject:files': 0.09; 'subject:image': 0.09; 'pm,': 0.10; 'wrote:': 0.14; 'exponential': 0.16; 'factor,': 0.16; 'numpy': 0.16; 'subject:raw': 0.16; 'cc:addr:python-list': 0.17; '(which': 0.20; 'header:In-Reply-To:1': 0.21; 'ignore': 0.21; 'file,': 0.22; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; 'values': 0.25; 'function': 0.25; 'typically': 0.28; 'matches': 0.29; 'cc:addr:python.org': 0.30; 'second': 0.30; 'array': 0.30; 'shifting': 0.30; 'subject:working': 0.30; 'it.': 0.31; 'does': 0.33; 'file': 0.34; 'however,': 0.34; 'expensive': 0.34; 'example,': 0.35; 'there': 0.35; 'header:User-Agent:1': 0.35; 'typical': 0.35; 'format.': 0.36; 'several': 0.36; 'pretty': 0.37; 'could': 0.38; 'but': 0.38; 'data': 0.38; 'third': 0.38; 'earlier': 0.38; 'hardware': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'received:192': 0.38; 'explain': 0.39; 'said': 0.39; 'subject:with': 0.39; 'received:192.168.1': 0.40; 'your': 0.60; 'traditional': 0.68; 'header:Reply-To:1': 0.72; 'reply-to:no real name:2**0': 0.72; '02:59': 0.84; 'bayer': 0.84 Date: Tue, 14 Jun 2011 19:25:32 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 MIME-Version: 1.0 To: kafooster Subject: Re: working with raw image files References: <0cd64f09-bd32-4b67-9266-46003dbea4b7@m4g2000yqk.googlegroups.com> <1f7a452a-8bae-43e0-ab9f-9bfed55ee206@b21g2000yqc.googlegroups.com> <57d6da80-59db-477f-b507-cabf01a2976d@j23g2000yqc.googlegroups.com> <720bec5b-4892-4cd7-83e1-f67ce78591be@y30g2000yqb.googlegroups.com> <71140671-4273-417d-8d2f-3986663acdb2@k16g2000yqm.googlegroups.com> <2c095413-ea59-4339-8419-ae4b688e219d@17g2000prr.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:J8WosJkgKUQ+czgcu3PXQipSpQftrVlrlBuHtYWokNQ ll/fIxnXkDyKEKtoPiXx8Ie4gq/whEzTIhhadUJnRPHalaeOqC idWG5zsvze7B4nTeGse/h/utZlSVFS4KJwge93nisN1GtSHPUG RYrDULISIe5ym2KfxJykGxQ49aXbZoU+//A0H0b2DpPxc+XWMr nRpco9dCv52LOO9aGLKow== Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: davea@ieee.org List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308093964 news.xs4all.nl 49046 [::ffff:82.94.164.166]:56515 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7644 On 01/-10/-28163 02:59 PM, kafooster wrote: > On 14 Cze, 22:26, MRAB wrote: >> >> Multiply the numpy array by a scaling factor, which is >> float(max_8bit_value) / float(max_16bit_value). > > could you please explain it a little? I dont understand it. like > multiplying each element? > You said in an earlier message to ignore the RAW format. However, if your file matches a typical camera's raw file, there are several problems: 1) the data is typically 12 to 14 bits per pixel, only rarely 16 (very expensive cameras) 2) the data does not have R, G and B values for each pixel, but only one of these. The others are generated by Bayer interpolation. 3) the data is linear (which is what the hardware produces), and traditional image data wants to be in some non-linear color space. For example, most jpegs are sRGB 8*3 bits per pixel. The first would mean that you'd need to do a lot of shifting and masking. The second would mean a pretty complex interpolation algorithm. And the third would require an exponential function at the very least. DaveA