MATLAB Answers

How to include an image with original resolution in a Live Script?

149 views (last 30 days)
I am creating an exercise for a course with a Live Script in Matlab 2016a.
I made some PNG drawings with free body diagrams. Unfortunately when they are inserted the Live Script, the image quality is dramatically decreased, making the text in the images very difficult to read. I tried also TIFF and JPEG with the same results.
Is there a way to include an image in a Live Script with the original quality and resolution?
Where can I suggest the addition of support for SVG or some format that support vector images?
Thank you.
Axel Jacobsen
Axel Jacobsen on 29 Jan 2021
This may be a bit late, but I found imshowing an imread worked at full resolution:

Sign in to comment.

Accepted Answer

Martin Knelleken
Martin Knelleken on 2 Mar 2021
Edited: Martin Knelleken on 3 Mar 2021
I'm very sorry for the delayed answer. I noticed this post only recently.
Regarding the quality loss of images: We are aware of that problem and we're aktively working on a solution. It's caused by a certain library we're using for loading images from disk. It has limits for the image size and the resize algorithm is poor.
Again, this affects only reading images from disk. It does not happen when you paste the image into the Live Script. Thus, if you have the chance to open the original image in another application (e.g. Paint on Windows, or Preview on Mac), you can copy it there and then paste in MATLAB. That should preserve the original solution.
Btw, MATLAB Online does not have that limitation. Just in case you're using it.
Regarding SVG support: We're working on that, too. Stay tuned.
Thank you for using the Live Editor and your feedback!
Kind regards
- Martin

More Answers (0)

Community Treasure Hunt

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

Start Hunting!