Conversation
# Conflicts: # libImaging/Filter.c
# Conflicts: # libImaging/Filter.c
PIL/Image.py
Outdated
| "instance or class") | ||
|
|
||
| if self.im.bands == 1: | ||
| multiband = getattr(filter, 'is_multiband', False) |
There was a problem hiding this comment.
All filters used to work only with single-channel images. As this is public API and there are can be custom filters in a wild, we can't just send multi-channel images to all filters. So is_multiband flag indicates that the filter is ready for multi-channel images.
There was a problem hiding this comment.
@wiredfool As of naming things is one of the hard problems in programming, I need your help there )
There was a problem hiding this comment.
I think that's a reasonable name, at least, I haven't thought of anything better.
There was a problem hiding this comment.
The another option is subclass MultibandFilter.
There was a problem hiding this comment.
That's probably cleaner, especially with an eye towards the typing PR.
| } | ||
|
|
||
| for (i = 0; i < kernelsize; ++i) { | ||
| kerneldata[i] /= divisor; |
There was a problem hiding this comment.
Precompute by dividing coefficients to divisor rather than each result pixel.
|
Oh my god! I clash with the same bug in Intel x64 CPUs with int to float conversion, as I did when was working on resampling for Pillow 2.7. In essence: GCC version < 4.9 (at least Ubuntu 14.04, Debian 7 Wheezy, Red Hat Linux 7) generates code which runs about 2.5 times slower than GCC >= 4.9. This can be fixed using ugly hack with assembler. We decided to include this hack in Pillow 2.7 (released Jan 1, 2015). After rewriting the resampling using fixed point arithmetics, this hack become obsolete and was removed in Pillow 3.3 (Jul 1, 2016). Unlike for resampling, I don't see a way to implement kernel filters on FPA. So, I suggest to include this hack again. |
|
I've just tried SSE4 for multiband images, with |
|
@wiredfool implemented through MultibandFilter |
Uh oh!
There was an error while loading. Please reload this page.