Python ImageFilter.BLUR Examples
The following are 5
code examples of ImageFilter.BLUR().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
ImageFilter
, or try the search function
.
Example #1
Source File: pilutil.py From Splunking-Crime with GNU Affero General Public License v3.0 | 6 votes |
def imfilter(arr, ftype): """ Simple filtering of an image. Parameters ---------- arr : ndarray The array of Image in which the filter is to be applied. ftype : str The filter that has to be applied. Legal values are: 'blur', 'contour', 'detail', 'edge_enhance', 'edge_enhance_more', 'emboss', 'find_edges', 'smooth', 'smooth_more', 'sharpen'. Returns ------- imfilter : ndarray The array with filter applied. Raises ------ ValueError *Unknown filter type.* If the filter you are trying to apply is unsupported. """ _tdict = {'blur': ImageFilter.BLUR, 'contour': ImageFilter.CONTOUR, 'detail': ImageFilter.DETAIL, 'edge_enhance': ImageFilter.EDGE_ENHANCE, 'edge_enhance_more': ImageFilter.EDGE_ENHANCE_MORE, 'emboss': ImageFilter.EMBOSS, 'find_edges': ImageFilter.FIND_EDGES, 'smooth': ImageFilter.SMOOTH, 'smooth_more': ImageFilter.SMOOTH_MORE, 'sharpen': ImageFilter.SHARPEN } im = toimage(arr) if ftype not in _tdict: raise ValueError("Unknown filter type.") return fromimage(im.filter(_tdict[ftype]))
Example #2
Source File: pilutil.py From lambda-packs with MIT License | 5 votes |
def imfilter(arr, ftype): """ Simple filtering of an image. This function is only available if Python Imaging Library (PIL) is installed. .. warning:: This function uses `bytescale` under the hood to rescale images to use the full (0, 255) range if ``mode`` is one of ``None, 'L', 'P', 'l'``. It will also cast data for 2-D images to ``uint32`` for ``mode=None`` (which is the default). Parameters ---------- arr : ndarray The array of Image in which the filter is to be applied. ftype : str The filter that has to be applied. Legal values are: 'blur', 'contour', 'detail', 'edge_enhance', 'edge_enhance_more', 'emboss', 'find_edges', 'smooth', 'smooth_more', 'sharpen'. Returns ------- imfilter : ndarray The array with filter applied. Raises ------ ValueError *Unknown filter type.* If the filter you are trying to apply is unsupported. """ _tdict = {'blur': ImageFilter.BLUR, 'contour': ImageFilter.CONTOUR, 'detail': ImageFilter.DETAIL, 'edge_enhance': ImageFilter.EDGE_ENHANCE, 'edge_enhance_more': ImageFilter.EDGE_ENHANCE_MORE, 'emboss': ImageFilter.EMBOSS, 'find_edges': ImageFilter.FIND_EDGES, 'smooth': ImageFilter.SMOOTH, 'smooth_more': ImageFilter.SMOOTH_MORE, 'sharpen': ImageFilter.SHARPEN } im = toimage(arr) if ftype not in _tdict: raise ValueError("Unknown filter type.") return fromimage(im.filter(_tdict[ftype]))
Example #3
Source File: pilutil.py From Computable with MIT License | 5 votes |
def imfilter(arr,ftype): """ Simple filtering of an image. Parameters ---------- arr : ndarray The array of Image in which the filter is to be applied. ftype : str The filter that has to be applied. Legal values are: 'blur', 'contour', 'detail', 'edge_enhance', 'edge_enhance_more', 'emboss', 'find_edges', 'smooth', 'smooth_more', 'sharpen'. Returns ------- imfilter : ndarray The array with filter applied. Raises ------ ValueError *Unknown filter type.* If the filter you are trying to apply is unsupported. """ _tdict = {'blur':ImageFilter.BLUR, 'contour':ImageFilter.CONTOUR, 'detail':ImageFilter.DETAIL, 'edge_enhance':ImageFilter.EDGE_ENHANCE, 'edge_enhance_more':ImageFilter.EDGE_ENHANCE_MORE, 'emboss':ImageFilter.EMBOSS, 'find_edges':ImageFilter.FIND_EDGES, 'smooth':ImageFilter.SMOOTH, 'smooth_more':ImageFilter.SMOOTH_MORE, 'sharpen':ImageFilter.SHARPEN } im = toimage(arr) if ftype not in _tdict: raise ValueError("Unknown filter type.") return fromimage(im.filter(_tdict[ftype]))
Example #4
Source File: pilutil.py From GraphicDesignPatternByPython with MIT License | 4 votes |
def imfilter(arr, ftype): """ Simple filtering of an image. This function is only available if Python Imaging Library (PIL) is installed. .. warning:: This function uses `bytescale` under the hood to rescale images to use the full (0, 255) range if ``mode`` is one of ``None, 'L', 'P', 'l'``. It will also cast data for 2-D images to ``uint32`` for ``mode=None`` (which is the default). Parameters ---------- arr : ndarray The array of Image in which the filter is to be applied. ftype : str The filter that has to be applied. Legal values are: 'blur', 'contour', 'detail', 'edge_enhance', 'edge_enhance_more', 'emboss', 'find_edges', 'smooth', 'smooth_more', 'sharpen'. Returns ------- imfilter : ndarray The array with filter applied. Raises ------ ValueError *Unknown filter type.* If the filter you are trying to apply is unsupported. """ _tdict = {'blur': ImageFilter.BLUR, 'contour': ImageFilter.CONTOUR, 'detail': ImageFilter.DETAIL, 'edge_enhance': ImageFilter.EDGE_ENHANCE, 'edge_enhance_more': ImageFilter.EDGE_ENHANCE_MORE, 'emboss': ImageFilter.EMBOSS, 'find_edges': ImageFilter.FIND_EDGES, 'smooth': ImageFilter.SMOOTH, 'smooth_more': ImageFilter.SMOOTH_MORE, 'sharpen': ImageFilter.SHARPEN } im = toimage(arr) if ftype not in _tdict: raise ValueError("Unknown filter type.") return fromimage(im.filter(_tdict[ftype]))
Example #5
Source File: image.py From Fruit-API with GNU General Public License v3.0 | 4 votes |
def imfilter(arr, ftype): """ Simple filtering of an image. This function is only available if Python Imaging Library (PIL) is installed. .. warning:: This function uses `bytescale` under the hood to rescale images to use the full (0, 255) range if ``mode`` is one of ``None, 'L', 'P', 'l'``. It will also cast data for 2-D images to ``uint32`` for ``mode=None`` (which is the default). Parameters ---------- arr : ndarray The array of Image in which the filter is to be applied. ftype : str The filter that has to be applied. Legal values are: 'blur', 'contour', 'detail', 'edge_enhance', 'edge_enhance_more', 'emboss', 'find_edges', 'smooth', 'smooth_more', 'sharpen'. Returns ------- imfilter : ndarray The array with filter applied. Raises ------ ValueError *Unknown filter type.* If the filter you are trying to apply is unsupported. """ _tdict = {'blur': ImageFilter.BLUR, 'contour': ImageFilter.CONTOUR, 'detail': ImageFilter.DETAIL, 'edge_enhance': ImageFilter.EDGE_ENHANCE, 'edge_enhance_more': ImageFilter.EDGE_ENHANCE_MORE, 'emboss': ImageFilter.EMBOSS, 'find_edges': ImageFilter.FIND_EDGES, 'smooth': ImageFilter.SMOOTH, 'smooth_more': ImageFilter.SMOOTH_MORE, 'sharpen': ImageFilter.SHARPEN } im = toimage(arr) if ftype not in _tdict: raise ValueError("Unknown filter type.") return fromimage(im.filter(_tdict[ftype]))