Python實現(xiàn)PS濾鏡中的USM銳化效果
本文用 Python 實現(xiàn) PS 濾鏡中的 USM 銳化效果
import matplotlib.pyplot as pltfrom skimage import iofrom skimage.filters import gaussianfile_name=’D:/Visual Effects/PS Algorithm/4.jpg’;img=io.imread(file_name)img = img * 1.0gauss_out = gaussian(img, sigma=5, multichannel=True)# alpha 0 - 5alpha = 1.5img_out = (img - gauss_out) * alpha + imgimg_out = img_out/255.0# 飽和處理mask_1 = img_out < 0 mask_2 = img_out > 1img_out = img_out * (1-mask_1)img_out = img_out * (1-mask_2) + mask_2plt.figure()plt.imshow(img/255.0)plt.axis(’off’)plt.figure(2)plt.imshow(img_out)plt.axis(’off’)plt.show()
實現(xiàn)效果:
以上就是Python實現(xiàn)PS濾鏡中的USM銳化效果的詳細內(nèi)容,更多關(guān)于python usm銳化的資料請關(guān)注好吧啦網(wǎng)其它相關(guān)文章!
相關(guān)文章:
1. 基于PHP做個圖片防盜鏈2. .NET中實現(xiàn)對象數(shù)據(jù)映射示例詳解3. 如何使用ASP.NET Core 配置文件4. jscript與vbscript 操作XML元素屬性的代碼5. php使用正則驗證密碼字段的復(fù)雜強度原理詳細講解 原創(chuàng)6. ASP.NET MVC使用Boostrap實現(xiàn)產(chǎn)品展示、查詢、排序、分頁7. asp.net core 認證和授權(quán)實例詳解8. uni-app結(jié)合.NET 7實現(xiàn)微信小程序訂閱消息推送9. XML在語音合成中的應(yīng)用10. 基于javaweb+jsp實現(xiàn)企業(yè)車輛管理系統(tǒng)
