Allow arbitrary extrapolation methods

Aberta
#703 3 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
python
Domínio
computer-vision

Direção de pesquisa

Start by tracing the Image.transform entry point, which the issue identifies as the priority, and compare how Image.filter handles pixels outside the image. Define the supported extrapolation methods and verify that transform can apply them, including an arbitrary Python function, with tests covering the listed border behaviors and transparent output.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Enhancement

Whenever a function needs to extrapolate values of non-existing pixels (i.e. pixels outside of the image), it should be possible to specify the extrapolation method to use.

The extrapolation methods I consider to be most useful are:

  • replicate border
  • replicate border, with alpha set to 0
  • arbitrary constant
  • wrap around
  • arbitrary Python function

See the introduction to http://docs.opencv.org/modules/imgproc/doc/filtering.html for further explanation and other extrapolation methods. There are several Pillow functions where this comes in handy. For example,

image.transform(size, PIL.Image.AFFINE, data, PIL.Image.BICUBIC, extrapolate=REPLICATE_BORDER_ALPHA0)

might produce a rotated and scaled version of the source image on top of a transparent background so you can paste this transformed image into other images easily. Another example:

image.filter(filter, extrapolate=WRAP_AROUND)

might produce a blurred image that you can use for a tiled wallpaper without ugly tile borders.

If you need to prioritize, I consider Image.transform to be more important than Image.filter. (This is because it is quite easy to work around this issue for Image.filter as soon as this is implemented for Image.transform.)

Linguagem predominante
Python
Estrelas
14k
Forks
2.6k
Merge médio
1d 1h
PRs com merge (30d)
205

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de python-pillow/Pillow

Todas as issues de python-pillow/Pillow

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.