Is there an efficient way to convert images to vector images like .eps, .ai, etc.?
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Richard McCulloch
il 23 Feb 2013
Modificato: Image Analyst
il 20 Feb 2023
Is there any way to create a vector image from a jpeg, png, etc.? I can convert images to binary contours, but that is about as far as I got. I am getting stuck on tracing the contour then exporting the data to an eps file.
Thank you in advance for any suggestions!
0 Commenti
Risposta accettata
Walter Roberson
il 23 Feb 2013
Modificato: Image Analyst
il 20 Feb 2023
I recommend that you use the MATLAB File Exchange contribution export_fig which is more likely to get the result correct than using the normal routines.
0 Commenti
Più risposte (3)
Image Analyst
il 23 Feb 2013
You can type "imformats" on the command line to see what imwrite() supports. If it's not there, then you're going to have to look for a custom file writer to do the job. You can look in the File Exchange.
0 Commenti
Jan
il 24 Feb 2013
Modificato: Jan
il 20 Feb 2023
As far as I understand, you have a file in pixel format and want to vectorize it. This is neither a problem for IMWRITE nor for EXPORT_FIG, but the problem is the division of the pixel image into areas.
3 Commenti
DGM
il 20 Feb 2023
The exported svg will contain vector objects where possible (e.g. the figure background, line objects, titles, labels, ticks), but raster cdata displayed with imshow()/image() are simply embedded as raster images.
That might allow something which has full SVG support to read the file, but it doesn't actually vectorize the raster content.
% a super-simple image
inpict = zeros(100);
inpict(25:75,25:75) = 1;
imagesc(inpict)
% export to svg
set(gcf,'renderer','painters');
export_fig 'testme.svg'
If I'm doing this wrong, I'm open to suggestions. Export_fig() is like a swiss army knife with just enough blades to make you doubt you're using the right one.
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!