python图像处理
前端技术
前端开发工程师
展开
-
用PIL制作底片滤镜
用PIL制作底片滤镜 话不多说,直接上代码! from PIL import Image import numpy as np def NegativeCV(path0,path1): try: a = np.array(Image.open(path0).convert('L')) print("原片的的大小为:{},原片的RGB值是:{}".format(a.shape, a.dtype)) b = 255-a im = Imag原创 2020-08-23 07:41:54 · 310 阅读 · 0 评论 -
用PIL制作手绘风格滤镜
用PIL制作手绘风格滤镜 话不多说,直接上代码! from PIL import Image import numpy as np def ArtDraw(path0,path1): try: a = np.asarray(Image.open(path0).convert('L')).astype('float') print("图片的大小为:{},图片的RGB值为:{}".format(a.shape,a.dtype)) depth = 10.原创 2020-08-23 07:41:19 · 242 阅读 · 0 评论 -
用PIL制作淡灰滤镜
用PIL制作淡灰滤镜 话不多说,直接上代码! from PIL import Image import numpy as np def GrayCV(path0,path1): try: a = np.array(Image.open(path0).convert('L')) print("图片的大小为:{},图片的RGB值为:{}".format(a.shape,a.dtype)) b = (100/255) * a + 150 i原创 2020-08-23 07:40:35 · 98 阅读 · 0 评论 -
用PIL制作深灰滤镜
用PIL制作深灰滤镜 话不多说,直接上代码! from PIL import Image import numpy as np def DeepGrayCV(path0,path1): try: a = np.array(Image.open(path0).convert('L')) print("原片的大小为:{},原片的RGB值为:{}".format(a.shape,a.dtype)) b = 255*(a/255)**2 im原创 2020-08-23 07:39:57 · 91 阅读 · 0 评论 -
用PIL制作黑白滤镜
用PIL制作黑白滤镜 话不多说,直接上代码! from PIL import Image import numpy as np def B_Wcv(path0,path1): try: a = np.array(Image.open(path0).convert('L')) print("原片的大小为:{},原片的RGB值为:{}".format(a.shape, a.dtype)) b = a + 255 im = Image.fr原创 2020-08-23 07:39:25 · 149 阅读 · 0 评论