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

58 vues (au cours des 30 derniers jours)
Carlo Monjaraz
Carlo Monjaraz le 13 Juil 2017
Commenté : Image Analyst le 22 Août 2024
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.
  6 commentaires
Nalini R
Nalini R le 22 Août 2024
Any update on this query on the resolution of the image inserted in live editor? I use 2023b version still i am facing issue with the image quality. Mathworks providing such great service why is this still not been resolved.
Image Analyst
Image Analyst le 22 Août 2024
I don't use live script so all I can suggest is to check out truesize or just use a regular script which will use regular, detached figure windows.

Connectez-vous pour commenter.

Réponse acceptée

Martin Knelleken
Martin Knelleken le 2 Mar 2021
Modifié(e) : Martin Knelleken le 3 Mar 2021
Hi,
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
  2 commentaires
Carlo Monjaraz
Carlo Monjaraz le 3 Mar 2021
Thank you Martin for your answer. It is appreciated.
Ricardo
Ricardo le 17 Déc 2022
Thank you for the answer. And +1 on thew fix and more so for the svg support! Hopefully this comes with better support for exporting with transparency as well.

Connectez-vous pour commenter.

Plus de réponses (2)

Michael
Michael le 4 Juil 2024
It seems like including .svg images inside live scripts is still not possible - any update on that?

Math Works
Math Works le 23 Juil 2022
so? still not fixed?
  2 commentaires
Martin Knelleken
Martin Knelleken le 28 Juil 2022
Unfortunately not.
The fix needs some other changes which turned out to take longer than expected. It's still in progress.
So, sorry for the delay and inconveniences.
Kind regards
- Martin
Alex Morgan
Alex Morgan le 28 Juil 2022
In the meantime, I would use Python if you have the image files saved, it is fairly simple even if you don't know it

Connectez-vous pour commenter.

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by