matlab 彩色eps,matlab-将图像写入EPS文件

一种可能的解决方案是使用

IMSHOW

,然后使用

PRINT

:

img = imread('peppers.png'); %# A sample image

imshow(img,'Border','tight',... %# Display in a figure window without

'InitialMagnification',100); %# a border at full magnification

print('new_image.eps','-deps'); %# Print the figure as a B&W eps

这个解决方案的一个缺点是,如果图像太大而无法在屏幕上显示,

伊姆斯

将缩小到合适的大小,这将降低图像的屏幕分辨率。但是,可以使用

-r

option for the PRINT function

. 例如,通过执行以下操作,可以将图形打印为分辨率为300 dpi的封装2级彩色PostScript:

print('new_image.eps','-depsc2','-r300');

编辑:

如果您无法使用

伊姆斯

(或者因为你没有

Image Processing Toolbox

或者因为您使用的是不允许使用的matlab模式),下面是创建和打印图形的另一种方法:

img = imread('peppers.png'); %# A sample image

imagesc(img); %# Plot the image

set(gca,'Units','normalized',... %# Set some axes properties

'Position',[0 0 1 1],...

'Visible','off');

set(gcf,'Units','pixels',... %# Set some figure properties

'Position',[100 100 size(img,2) size(img,1)]);

print(gcf,'new_image.eps','-depsc2','-r300'); %# Print the figure

你也可以看看

this documentation

看不到显示器的打印效果。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值