我想在我的整个项目目录中将pylint配置为外部工具,用于我正在处理的python项目.我试图将存储库用作带有__init__.py
和不带的模块,并且它无论如何都不起作用.
我在设置pylint以使用PyCharm时遇到困难.我知道我应该将它作为外部工具运行,但设置让我感到困惑.
他们的文档的权威来源被打破了,所以我也无法检查它.
我想要实现 Photoshop 中提供的渐变映射效果。已经有一篇文章解释了期望的结果。另外,这个答案完全涵盖了我想做的事情,但是
im = Image.fromarray(np.uint8(cm.gist_earth(myarray)*255))
Run Code Online (Sandbox Code Playgroud)
不适合我,因为我不知道如何将数组标准化为 1.0 的值。
下面是我的代码,因为我想让它工作。
im = Image.open(filename).convert('L') # Opening an Image as Grayscale
im_arr = numpy.asarray(im) # Converting the image to an Array
# TODO - Grayscale Color Mapping Operation on im_arr
im = Image.fromarray(im_arr)
Run Code Online (Sandbox Code Playgroud)
任何人都可以指出将颜色图应用于该数组的可能选项和理想方法吗?我不想绘制它,因为似乎没有一种简单的方法将 pyplot 图转换为图像。
另外,您能否指出如何规范化数组,因为我无法这样做并且无法在任何地方找到帮助。