python create thumbnails and select an outline effect

# - * - encoding: UTF-. 8 - * - 
'' ' to change the color of the color reversal --- ' '' 
from the PIL Import Image 
Nest = Image.open ( " D: \\ tk.jpg " ) 
R & lt, G, B = nest.split ()            # Get original RGB color channel value 
newb = b.point ( the lambda I: I * 1.1) # color value B channel enhancement 
NEST1 = Image.merge (nest.mode, (B , G, r)) 
nest1.thumbnail (( 400,254))      # create a thumbnail 
nest1.save ( " D: \\ nest_2.jpg " )
Select an outline effect
# - * - encoding: UTF-. 8 - * - 
'' ' contour effect Sketch --- ' '' 
from the PIL Import Image
 from the PIL Import ImageFilter 
Square = Image.open ( " D: \\ tk.jpg " ) 
square1 = square.filter (ImageFilter.CONTOUR)   # select an outline effect 
edge enhancement
square1=square.convert('RGB').filter(ImageFilter.EDGE_ENHANCE)
#ImageFilter.EMBOSS 浮雕

square1.save("D:\\square0.jpg")

 

smooth

im.convert('RGB').filter(ImageFilter.SMOOTH)

Sharpen

im.convert('RGB').filter(ImageFilter.SHARPEN)

Sharpen mask

im.convert('RGB').filter(ImageFilter.UnsharpMask(radius=2, percent=150, threshold=3))

Guess you like

Origin www.cnblogs.com/gisoracle/p/12040506.html