png to eps conversion

조회 수: 11 (최근 30일)
Raviteja
Raviteja 2011년 11월 13일
댓글: Rahul Singhal 2017년 5월 5일
I want to convert an image .png to .eps converstion.. Can you please suggest me the code..
I=imread('rp_noise.png');
imwrite(I,'rp_eps.eps','eps');
showing error ???Invalid input syntax or unrecognized format "eps"
Help me!
  댓글 수: 1
Rahul Singhal
Rahul Singhal 2017년 5월 5일
Hi,
Following code may help you to convert PNG images to eps (COLOUR)
fileName = 'FarmerStats'; % your FILE NAME as string
A = imread(fileName,'png');
set(gcf,'visible','off') %suppress figure
image(A);
axis image % resolution based on image
axis off % avoid printing axis
set(gca,'LooseInset',get(gca,'TightInset')); % removing extra white space in figure
saveas(gcf,fileName,'epsc'); % save as COLOR eps file

댓글을 달려면 로그인하십시오.

채택된 답변

Wayne King
Wayne King 2011년 11월 13일
Make the plot that you want in MATLAB and save the plot as an .eps file
print -depsc figure.eps
or the appropirate -deps option, see the help for print.

추가 답변 (2개)

Walter Roberson
Walter Roberson 2011년 11월 13일
imwrite() cannot create eps. Use print(), or use Oliver's File Exchange Contribution "export_fig".

Daniel Shub
Daniel Shub 2011년 11월 13일
You realize that png is a bitmap image format and eps is traditionally used for vector graphics. While you can embed a bitmap image into it, it is unclear why you would want to convert a bitmap graphic into a vector graphic.
  댓글 수: 1
Raviteja
Raviteja 2011년 11월 13일
I want to use it in Latex documentation..

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by