python 灰度图像转彩色,是否有任何好的色彩映射表,可以使用python的PIL将灰度图像转换为彩色图像?...

本文探讨了如何使用Python的PIL库和matplotlib库将灰度图像转换为彩色图像,特别是在处理大量图片时,强调了性能的重要性。通过比较matplotlib的色彩映射与PIL的转换效率,结果显示PIL在性能上更优。
摘要由CSDN通过智能技术生成

Matplotlib has a lot of good color maps, but is bad in performance. I'm writing some code to make gray-scale image colorful where interpolate with color map is a good idea. I wonder whether there are open source color maps available or demo code to use Pillow to convert gray-scale images into colorful ones via colormap?

Clarify:

Matplotlib is good for demo use, but bad performace for thounsands of images.

You can map grayscale images to colormaps to get colorful ones.

Demo:

The first image is grayscale, second is mapped in 'jet' cmap, third being 'hot'.

0dca779e126424a52c50b076e89ad905.png

The problem is that I do not know much about colors, and I'd like to achieve such effects in PIL for better performance.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值