Skip to content

RGBA conversion breaks edge detection #4321

@BernardZhao

Description

@BernardZhao

What did you do?

I am having an issue with Pillow's edge detection, specifically after I convert my source image to RGBA. For context, I open a .jpg file, and edge detection works fine on the image. However, after conversion the detected edges are all blank. Am I doing something wrong that involves the new alpha channel? See the code below to replicate:

What did you expect to happen?

I expect the edges of the images to be detected, producing an image like this:

image

What actually happened?

Instead, a blank image is generated:
image

What are your OS, Python and Pillow versions?

  • OS: Mac OSX Catalina
  • Python: 3.7.5
  • Pillow: 6.2.1
from PIL import Image, ImageFilter
image = Image.open("examples/image.jpg")
image.filter(ImageFilter.FIND_EDGES).show()
image = image.convert('RGBA')
image.filter(ImageFilter.FIND_EDGES).show()

I have also tried this with other ImageFilters, and they seem to work fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions