I have got a numpy array a of type float64. How can I blur this data with a Gauss filter?
I have tried
from PIL import Image, ImageFilter
image = Image.fromarray(a)
filtered = image.filter(ImageFilter.GaussianBlur(radius=7))
, but this yields ValueError: 'image has wrong mode'. (It has mode F.)
I could create an image of suitable mode by multiplying a with some constant, then rounding to integer. That should work, but I would like to have a more direct way.
(I am using Pillow 2.7.0.)
a, would it suffice to "blur" the data directly without creating an image first? - Carstenimage = image.convert('L')and the applyImageFilter.GaussianBlur? - Zero0.03. This cannot be directly converted to 'L', since 'L' means '8 bit greyscale'. - Robert Pollak