1
# Phatch - Photo Batch Processor
2
# Copyright (C) 2007-2008 www.stani.be
4
# This program is free software: you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation, either version 3 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program. If not, see http://www.gnu.org/licenses/
17
# Phatch recommends SPE (http://pythonide.stani.be) for editing python files.
19
# Embedded icon is taken from www.openclipart.org (public domain)
21
from core import models
22
from core.translation import _t
26
global Image, ImageFilter
27
import Image, ImageFilter
29
def maximum(image,radius,amount=100):
32
maximumed = image.filter(ImageFilter.MaxFilter(radius))
34
return Image.blend(image, maximumed, amount/100.0)
38
class Action(models.Action):
41
email = 'spe.stani.be@gmail.com'
42
init = staticmethod(init)
43
pil = staticmethod(maximum)
46
__doc__ = _t("Copies the maximum pixel value")
48
def interface(self,fields):
49
fields[_t('Radius')] = self.RankSizeField(self.RANK_SIZES[0])
50
fields[_t('Amount')] = self.SliderField(100,1,100)
53
'x\xda\x01\xba\x08E\xf7\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x000\x00\
54
\x00\x000\x08\x06\x00\x00\x00W\x02\xf9\x87\x00\x00\x00\x04sBIT\x08\x08\x08\
55
\x08|\x08d\x88\x00\x00\x08qIDATh\x81\xd5\x99{\x8c\\U\x1d\xc7?\xe7\xdey\xcf\
56
\xcev\xf6\xbd[\xfa\xb0\x84%Bk\xe5Q\x82\x956\xa1\x98\xc66\xf5\x01!\xd4*Z\x81\
57
\x18\x95\x87`\x02$\x1acz\x0b\xc4\x88\x98(\x1a\xb4Q"V"\xda\x14\x8d\x84\x02\
58
\x02Q\x03RM\xd1j06\xe9c\xd7n\xdb\x9d\xd7nw\xe7\xb53s\xef\xdc\xc7\xf1\x8f3;\
59
\xddmw\xdb\x99e\xed\xca7\xb9\xd9\xbds~\xe7w\xbe\xdfs~\xbf\xdf9\xf7^\xc1\x1c\
60
\xb0s\x94-\xcbKW\xee:\x15\xfcO\xa2\x8a\xf9\xbc\x1e\xe0\'F\x07\x85\xb9\xf8z\
61
\xb7\x10\x8d\x18\x19\x12\x9f\x96\xe2\x83\x9e`-\x82\xb5\xa52\xdb"a4\tT\xab\
62
\x80\xcdD(\xc2\x16c1o\xfeo\xe9\x9e\x0b\xdf\xf9\x1a\x8d,qQ\xe5\x019\xc2\x03\
63
\x9eF\x9biB:\x03\x95\n\x8c\x8dB(\x02]\x1d\xa0\xe9\x84{|\xe8\x17\x8b\xf4T\xcc\
64
\xba\x02\x8f$Y\xefi\xecq]\xfa\xb2\xe3\x90\xcb\x83\xe7Q\x9e\x98\xa0(\xa1\x10\
65
\t\xd1\xe6INF[\xf8\xb9\x9b\xe3g\xcf~\x94\xd2\xc5$>\x89\x19\x05\x18\x19nF\xb2\
66
\xb7T\xc2w\xea\x14\x04\x83\x8c\xb6-\xe2\xce\xef_\xc9K\x17\x9b\xe0\x85p\x8e\
67
\x00#\xcd*\xe0@\xc5$2t\x1cb-\xfce\xc9\x1a\xd6\x1b\x02o\x01\xf8]\x103\xe5\xc0\
68
\xe3R\x12I\x0cC$\xc2\xc0\xd3\xd7q\xc3Eg\xd5\x04\xb4\xa97F\x86\xd5\xc0\xe6B\
69
\x01\x1c\x07\xaf5\xc2\xba\x05\xe2\xd50\xa6\t\xc0c\x13 \xf2y\x88Fy\xf3\xc9\
70
\x0f\x90Y\x18Z\x8dc\xba\x00\xc1:$\x94\xcb 4\x1e] NMA;\xeb\xfe\x06\xcb\x86H\
71
\x94\xca\xd3\xd7\xf0\xa7\x05a\xd4$\xea\x02\x1e\x1f%\x06\xb4\x9b\x15\x88\xc58\
72
\x82@. \xaf\x86Q\x17`W\x89\x038\x0e\x00\xce\x02\xf1i\x1au\x01\x8e\x8f\xb6\
73
\xc9\xff\xf5\xf7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\\t\xe9\x14\\2\x19\x99\x92\xafhp\xc0\x13|\x19\xd8\x06D\x1a\
88
\x18\xe3\xaf:\xdc\xfe\xcd^\x8e7B\xe8s\xfby\xa9\xbb\x8b\xc8w\xfb\xb9\xa9\x11\
89
\xe13\x9ew\xfa\xff\xc0.\xc7\xc6*\x16\xd4\xe1\xaeX\xac[?\xe9\t\xde\x06\xeej\
90
\x90<\xc0Z\x17\x0e\x18I\xd64b\xec\xc6\xf8l*\xc5\x87\x1e\xc9\xb0\xad\x11\xfb\
91
\x19\x05\x18\x06\x9e\xcf\xc7\x9eTB%s\xb9\x0c\xae\x07\xcc\xfd\x80\xd7\x85\xc6\
92
~c\x98\xed\x172|n5Y\xdb#%\xe5\x99p=\x1ff%$\xe0~\xd3\xc6\xc9\x8eAg\'\x8cdxW\
93
\x0f\t\xe5\n\x01\xa9\xb1\xdbH\xf2\xcac\xa7\xcf_.\x85$\xe3z\xacj\xc4\xef\xac\
94
\x02\xf6n$\x1f\xf4\xf1\x8bTZ%JK\x0b$\x13\xaa\xb4zsx\xc5%\x80T\x1a\xca\x1569\
95
\x0e\xff\xda\x99b\xf3l\xb6\xc1\x00E\t\xf1\x1f\x1c#8g\x01\x00r\x9c\xbb=\x97\
96
\xe2\xd8\xb8\xca\x85Eq\x95\xd4CC\xb5\x90j\x02\xe10\xe4\xf3\xa0\xfb@z\xb4K\
97
\xc1\x8b;S3\xd7}_\x80\xa8O\x87\xf1(\xb1w%`\xefV\xaa\x91\x00\xdbM\x13l\x1bZ\
98
\xa2\xb0|\xb9:\xec\xe9\rf\xc3\xd4\xd5\xea\xee\x81\\A\xbd\xdd\x06t)\xf8\x8e\
99
\x91\xe6{RN\xaf\x86\x1a,\x03<\xfa\x18\xbf\x90\xff\x86\xbe\x0f\xac\xff%\x95\
100
\xae.B\x97]V\xdb\x13\x00\xd1PO\xa8Z\x10\x08\xd4F\x92p\xec\x18\xf4\xf5\x81?\
101
\x00\xc13\x01\xf2\x1cc\xdci\xac\xa4z\xd7[,\x0e\xc78\xde\xd5C\xce\xe8\xa5\xe7\
102
B\xfe\x1b\x9a\xc7p\x84\x9f\xe6\xf3p\xea\x94*\xa9\xb3\x91\x9f)7\\\x0fl\xb7v#\
103
\xd4\x19K\xf3\xc1\xf8x\xfd\r\x08\xc0gh\xe7\x05\xe3\x10\x01\x02\xechYD\x00\
104
\x18h\x84[C\x02^\xbb\x85\xfbCa2\x12%\xa0P\x00)\xd5U\'\xea\x82i\xaa/6\xae;\
105
\xfd\xf7\xc9p\xb3m\x08\x86\xc0\xa7\xab0\x9a\x98\x982\x88`\x13\x1d<kY|2\x1c\
106
\x04\x04G\xe7M\x00@k\x94\x1bKe\x1c\xcfS3\x9d\xcbA\xb9\xa2\xc4\x98\xa6Z\x95B\
107
\x11FFT\xdb$<\xa9\xdaA\xfd\x1e\x8b)\xe1\xe5R\xed\xc4;e\x12,\x8b\xadB\xa3\x1b\
108
\x01\xc2\xe3p#\xbc\xce\xfb\x89i*~\xb5\x81\xc3\xb7\xbd\xce\xcd\xc3\xc3\xec\
109
\xd34\xd0u\xd04hkW3\x1c\x8b\x81S\x85S\xc3\xd0\xd1\xa1.\x00\xd7\x81\xc4\xb0\
110
\xb2\x9f(\xc1\xe5\x97\xab\t(\x97U\x18E\xa3g\xf2*\x91\x84x\xab\xcaK\xa9qd^\
111
\x05\x00\xec\xdd\xc8Kw\x1d 3x\x9c\x9e|\x1e\x02~E"PKF\x9f\x0e\xd9q\xf0M\xf1*4\
112
\xb0,\xb5R\x1a\xea\xb2m\x18\x1bWW.\x0bK\x96\xaa\xc4\x9e(BW\xa7\xea\xa7i\x8d\
113
\x1d\xe6\x9a>\x1ah\x1a\xa9\xee.Xr\t\x04\x82\xc8b\x01N\x8f\xaa+\x9d\x06\xab\n\
114
\xa5\x12\x9c<\xa9\xc2C\xd7!\x99\xc4\x13:\x8e?\x08R@k\x8cW\xaf\xbe\x9a%+.\xe3\
115
\xa9\x8a\x85\x9dL\xc2\xf0\xb0\x12:Y\x17\xa5\xcb\x8e\xb3\xcb\xeb\xbc\x08\xe8\
116
\xee\xe6\r\x9f\x1f\xc6\xc6 \x1c\xa4\xb8v-\xe5\xa5\xcb \x1e\x87P\x08\x02\x01\
117
\xa4\xeeCV-5\xa3\xa1\x10Ew5\xa1H\x88C\x81 86\x08\x8d\xce]W\x91\xf8\xf5z\xee\
118
\xbb\x1b\xc2\x12\x063i%\xd8\xae\xd6\x04\xc0\x86\x9d\x19\xbe5\xef\x02rY:\x1d\
119
\x1b\x16\xf7A0@V\xd7\xc8\x85C*\x89#\x112\x7f\xff\x02Z\xac\x95\xd7:: \xd6\n~\
120
\x1f{\x0f\xae\xc1\xb6,\x02B\xaa\x98\x97\x1e\x95I\x7f[\xb7\xe2\xee\xdbB\xbf\
121
\xaes\xc2\x93\xeak\xe8\x14|\xcd\xc8\xf0\xd0\xbc\npe\xed|"\xa0\\A\x08\x9d\xa3\
122
B\xd4\x92YWm\xc1\x00n0T\xef\xd2\t\xe0\xf7\xa3wt\xd6\xf2C`M\xf5)\x04r\xdd5\
123
\xac\x0c\x87\xb0FF\xea;\xb5\x82\xe4\x89\x1d)v?\x91&:/\x02\xaaU\xfe\x06*^\x1d\
124
\x97\x18\xa8z\xed\xf7\x81\xed\xa8\xb7\n\xc1\x10\xb66\xe9Y\xd2^\xfb\xeb\xd4\
125
\x93[\x928\xdb\xef\xc3\xbd\x94V]\xca\xb5fE\xe5C\xb5:M\xe0\xf6\xb2 k\xa4\xd9o\
126
\xa4x\xc8\x90g\x8aO\xd3\x02\xf4Zy\xf3\xf9@\x80\xe6\xb9\xbc3\xd9\xe6y\xca\x9f\
127
\xae\x9d;[\xba\x9f\x9c\xdf_\x1f\xf5\x9d\xb3\xdb\x01\x1e\xed\xe7P{\x07\xbfK$`\
128
p\x10\xb2Y\xb5\x8f\x00H\x89\x1f\xf80\x82\'\x18a\xef\x9c\x05\x04}\xd8\x8e\xa3\
129
\xaa\x8d\xa6\xe3T+\x1c\x03\xb51\xd9\xb6\xaa\x1a\xc5"}\xc7\x06\xa0T\x06\x04e\
130
\x80x+\x9ae\xd57\xae\x7f\xcf\xe6\xff\xb7\x1b\xb9%\x12\xe1\xe0\x89!\x188\x06G\
131
\x0eC"\xa1\xc4\x98\xa6\x12$$\xd7O\xda7\xb5\x0f\x00d\x07\xbb7\xe8C\xab!6\x88\
132
\xd6q\xfc\xb4=\xda\xd1\xe7\x9dX\x81\xd6u\x94\xaaY\x10w<\xf3\xbex\xfa\x95U\
133
\xfdW|d\x1c-\x9b\xc4edh\xdb7\xd6-=\xfd\xb2w\xdd\xb2\x1bNb\xe9e\xfc\xad\xf9\n\
134
\x14g\x1d\xe3\xe5O\xb0\xe6c/\xf2\xa9\x89\tv\x8f\x8c\x10\x0cGj\x15.\xa8\xf6\
135
\x9a\xde)\xcf\xd7M\x0bH\xfe\xb1kg\xe7\x121p\xe9\x12\xf3\xf7Om\xe1\xc4m\xb7\
136
\xdd\xa4\x8f-\x1b~\xfb\xba5\xb8\xfe.\xba\x9f\xd90\x94\xbfcw\xdbF\xfb\xf4\x8a\
137
xu\xac\xc7\x8bv\x0f\xfd\xc3\xed\x10f\xbb\xa6m.\x0e,MD-/,\xed\xc2\x00\x1c<\
138
\xef8\xfb>\xce\x1e`\xcf\x8d\x06>\xed\xfd\xdc\xe7ylw\x1c\xe2\xa1\x10\xaf\xee\
139
\xba\x8a\xbb\'\xed\xfe\x0bf.D\xbc\xac\x02\x0bc\x00\x00\x00\x00IEND\xaeB`\x82\