PIL image.filter -> boundaries

P

pieter.cogghe

Hi,

I'm filtering an image with a custom kernel. It works fine, except for
the boundaries. image.filter() seems to add a 1px zero-border to the
image to process the pixels at the boundaries of the image.I'd rather
have it replicate the values of the boundary pixels. Is this an option
and where can I set it?

thanks,

Pieter

ps, the code:

img = Image.open('cell.tif')
kernelX =
ImageFilter.Kernel(size=(3,3),kernel=[1,0,-1,2,0,-2,1,0,-1],scale=8)
gradientX = im.filter(kernelX)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,792
Messages
2,569,639
Members
45,351
Latest member
RoxiePulli

Latest Threads

Top