A black and white filter for Matlab figures
13 次查看(过去 30 天)
显示 更早的评论
Creating grayscale images from Matlab figures can be a big pain because you have to scale your colormaps and color limits just right so that the gray colormap picks up all the details. I've realized that Photoshop is very, very good for doing this. You load in an image and use the black and white filter, and then change the levels of reds, greens, blues, etc.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152370/image.png)
I think it would be extremely useful to have a function that one can call that takes in the same inputs as Photoshop requires. This function might be of the form
function bwfilter(h, C)
where C is a matrix that takes in the input of red, green, cyan, etc. percentages, and h is a figure handle. Upon running the function, the figure is converted to black and white and either kept as Matlab's .fig format, or if not possible, exported as a png, pdf, etc. perhaps using the excellent export_fig function by Oliver Woodford.
I'm not sure how to go about this. Can someone advise? Of course, if anybody wants to step to the challenge...
4 个评论
millercommamatt
2022-12-15
编辑:Walter Roberson
2022-12-15
Where does the cmap2gray function fall short for you?
DGM
2022-12-15
cmap2gray() does the same thing as rgb2gray() and im2gray(). It's a simple fixed BT601 luma conversion.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Orange 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!