How to export non-blurry eps images?

后端 未结 10 1848
攒了一身酷
攒了一身酷 2020-12-15 07:08

I\'m exporting an image in Matlab using the eps format, but it smooths the image. Matlab does not blur the image using other formats such as png. I would like to know how to

10条回答
  •  盖世英雄少女心
    2020-12-15 07:57

    UPDATE:

    The problem is reproducible on a Mac, and the issue is with the eps renderer rather than MATLAB. For e.g., saving imagesc(rand(20)) and viewing with Preview and GSview results in the following:

    Preview screenshot

    enter image description here

    GSview screenshot

    enter image description here

    Clearly, the information is not lost. It is just not interpreted/read correctly by some EPS viewers. The solution is simple: use GSview to view your eps images. You can download it from here

    On Macs especially, if your end application is latex/pdflatex, you will have to explicitly set it to use GS/GSview, because otherwise, it will default to the Quartz engine, which is baked into the OS.


    PREVIOUS ANSWER:

    I am unable to reproduce the behavior your described. Here is the code I used, tested using R2010b on WinXP 32-bit:

    M = fspecial('gaussian',[20 20],5);
    imagesc(M)
    print('-dpng','a.png')
    print('-depsc2','b.eps')
    

    a.png

    a.png

    b.eps

    b.eps

    Perhaps this is an issue with your EPS viewer...

提交回复
热议问题