home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 116
/
FreelogNo116-JuilletSeptembre2013.iso
/
Bureautique
/
gImageReader
/
gimagereader_0.9-1_win32.exe
/
bin
/
ImageEnhance.pyc
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2011-03-24
|
2KB
|
51 lines
# Source Generated with Decompyle++
# File: in.pyc (Python 2.7)
import Image
import ImageFilter
import ImageStat
class _Enhance:
def enhance(self, factor):
return Image.blend(self.degenerate, self.image, factor)
class Color(_Enhance):
'''Adjust image colour balance'''
def __init__(self, image):
self.image = image
self.degenerate = image.convert('L').convert(image.mode)
class Contrast(_Enhance):
'''Adjust image contrast'''
def __init__(self, image):
self.image = image
mean = int(ImageStat.Stat(image.convert('L')).mean[0] + 0.5)
self.degenerate = Image.new('L', image.size, mean).convert(image.mode)
class Brightness(_Enhance):
'''Adjust image brightness'''
def __init__(self, image):
self.image = image
self.degenerate = Image.new(image.mode, image.size, 0)
class Sharpness(_Enhance):
'''Adjust image sharpness'''
def __init__(self, image):
self.image = image
self.degenerate = image.filter(ImageFilter.SMOOTH)