Al momento, stai seguendo questo contributo
- Vedrai gli aggiornamenti nel tuo feed del contenuto seguito
- Potresti ricevere delle email a seconda delle tue preferenze per le comunicazioni
Matlab function for exporting figures in PNG is terrible. There is no anti-alias (although something better has been tried with the new graphic engine) and even increasing the exported file resolution, images still look horrible.
The best solution that I've found for exporting images in a nice way is saving them in SVG and exporting them to PNG using Inkscape, but this requires a lot of time. For this reason, I coded this very basic routine that takes care of everything: first, the image is saved in a vectorial format (SVG) using "print", then Inkscape is invoked through command line to export the SVG file in a PNG with the desired resolution.
This function uses Matlab internal SVG printer, which has been introduced since R2014a. If you have a previous Matlab version you may want to use the following script from the File exchange to export images to SVG:
http://www.mathworks.com/matlabcentral/fileexchange/7401-scalable-vector-graphics--svg--export-of-figures
Cita come
Alessandro Masullo (2026). ExportPngInkscape(filename,dpi,handle) (https://it.mathworks.com/matlabcentral/fileexchange/54300-exportpnginkscape-filename-dpi-handle), MATLAB Central File Exchange. Recuperato .
Informazioni generali
- Versione 1.1.0.0 (1,81 KB)
Compatibilità della release di MATLAB
- Compatibile con qualsiasi release
Compatibilità della piattaforma
- Windows
- macOS
- Linux
