[英]Create a grayscale image from a color coded source image in Python
我想將彩色編碼圖像轉換為灰度。 該圖像中的 colors 對應於該色標上的給定值(例如,黑色為 0,紅色為 25)。
有沒有辦法將此圖像轉換為灰度並保持該顏色漸變,以便刻度上的 0 保持黑色而 25 顯示為白色?
我試圖用 matplotlib 和 cv2 轉換它,但最終得到了灰度圖像,這不符合我給定的顏色漸變。 我非常感謝您的回答。 謝謝!
根據您使用的工具,您可以
或者
第二種方法更有效。
更新:
閱讀您的最后一條評論(應該在原始問題中)后,選項變為
[英]create a color coded image from 2D array of angles
[英]How to color a 3d grayscale image in python
[英]create multi-colored thresholded image from grayscale heatmap in python
[英]create a grayscale image
[英]Python 3: Converting image to grayscale
[英]Grayscale Image to SVG in Python
[英]Uploading grayscale image Python
[英]Turn a image to grayscale in python
[英]Converting image to grayscale python
[英]Python Grayscale image to RGB
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.