cp wrote:
>> I don't know anything about PIL and its implementation, but I would not
>> be surprised if the cost is mostly accessing items which are not
>> contiguous in memory and bounds checking ( to check where you are in the
>> subimage). Conditional inside loops often kills performances, and t
> I don't know anything about PIL and its implementation, but I would not
> be surprised if the cost is mostly accessing items which are not
> contiguous in memory and bounds checking ( to check where you are in the
> subimage). Conditional inside loops often kills performances, and the
> actual co
cp wrote:
>>> The image I tested initially is 2000x2000 RGB tif ~11mb in size.
>>>
> I continued testing, with the initial PIL approach
> and 3 alternative numpy scripts:
>
> #Script 1 - indexing
> for i in range(10):
> imarr[:,:,0].mean()
> imarr[:,:,1].mean()
> imarr[:,:,2].mea
>> The image I tested initially is 2000x2000 RGB tif ~11mb in size.
I continued testing, with the initial PIL approach
and 3 alternative numpy scripts:
#Script 1 - indexing
for i in range(10):
imarr[:,:,0].mean()
imarr[:,:,1].mean()
imarr[:,:,2].mean()
#Script 2 - slicing
for i in ran
On Wed, May 27, 2009 at 10:33, cp wrote:
> Testing the PIL vs numpy in calculating the mean value of each color channel
> of
> an image I timed the following.
>
> impil = Image.open("10.tif")
> imnum = asarray(impil)
>
> #in PIL
> for i in range(1,10):
> stats = ImageStat.Stat(impil)
> stat
Testing the PIL vs numpy in calculating the mean value of each color channel of
an image I timed the following.
impil = Image.open("10.tif")
imnum = asarray(impil)
#in PIL
for i in range(1,10):
stats = ImageStat.Stat(impil)
stats.mean
# for numpy
for i in range(1,10):
imnum.resha