low quality image/picture after importing in LibreOffice

Hi,

I’m sorry if this has already been asked or if it is a known issue, but since I couldn’t find a clear answer, I’d like to ask whether it is possible to import an image/picture in LibreOffice without losing quality/resolution and if so which file formats are recommended in order to do so.

I’m attaching an example:

example.odp

The first imported graph is
sin1.png (directly exported from gnuplot), whereas the second is sin2.png (a screenshot from my MacBook). These are the original pictures, you can see the result of importing them in the presentation.

Update:
I also have another question: why is the rendering of svg images so bad both in normal mode and in presentation mode unless one exports to PDF? I’d really like to be able to use the presentation mode, but I currently prefer to export everything as pdf and use a pdf viewer for my presentations. I’m using LO version 6.3.0.4.

Examples here: test.odp test.png

Note: test.png is a png obtained by exporting the pdf version of the presentation, as I cannot attach pdf files.

Which format do you try to insert? The preferred internal format is png. LibreOffice cannot handle EPS.

Why do you want to insert images? The images are surely not altered, if they are linked. You only need to put image and presentation together into a folder and always move the complete folder.

Thanks Regina for your comment. I tried linking the image (a very LaTeXish thing, by the way!) instead of inserting it, but that doesn’t seem to change anything.

Extracted the images from the file.
They are identical to the originals.
The first image in the presentation looks OK to me.
The second screenshot image original is aliased and fuzzy.
Looks the same in the presentation … bad.

@peterP1: I see the same as @LibreTraining. If the images you had linked here are the originals, then LibreOffice didn’t touch a bit in them. The SHA256 hashes for the images are identical for the linked images, and for those which are in the ODP (which is actually a ZIP).

The first image looks the same as the original (yes, the linked images are the originals) and actually looks fine to me as well. I agree with you that the second image is blurred, but the corresponding one in the ODP looks worse and quite pixelated to me, very similar to this: Why do images copied to Libre Office Writer look so pixelated? - Super User. I guess this has to do with the bug they mention? https://bugs.documentfoundation.org/show_bug.cgi?id=86675

The two images side-by-side show that every pixel in the original corresponds to the pixel in LibreOffice. Antialiasing makes it somewhat blurry, but still - again: there’s pixel-to-pixel correspondence visible on this zoom level.

You’re right Mike, I see the same when I zoom. Thank you very much for checking this.

Before closing this question, I would like to point out that while the actual quality of the image might not be affected (as it happens when importing png and svg images), it might happen that the on-screen quality of the images appears to be bad, which might be a problem if you intend to give a presentation using your odp file rather than exporting it to pdf and using the latter. This is what I see when importing svg files. It would be nice if this could be fixed sooner or later, meanwhile I think it is good idea to stick to (possibly high resolution) png files. However, in the case of svg files, I can see that at least – if one exports to pdf or prints the document – the image quality is excellent, which is good news as long as one restricts himself to using the software for printing purposes.

Same issue found me here…

EDITED: I’d better to start a new thread:

LibreOffice should not worsen imported image quality. It should simply keep the image which was imported, unmodified. If it’s not so, then please feel free to file a bug attaching the source data files that have better quality before import.

Thanks Mike for your answer, I’ve edited my question and provided an example.

The quality of the images are very different. sin1.png has 2048×1536 pixel and is down scaled to 34%. The image sin2.png has 1266×762 pixels and is scaled to 91%. If you open both images with a raster image app, and look at it at 100% scaling, you will notice, that sin2.png is a snap shot of an anti-aliased image and therefore is already blurry in itself. If you now add smoothing in LibreOffice it will become more blurry. The sin1.png is the pure drawing and is not blurry in itself. Anti-aliasing in LibreOffice has about three pixels to make one new pixel for rendering. That will give high quality in anti-aliased rendering.

If you want to have high quality, independent of the used scaling, you should make your drawings directly in LibreOffice as vector graphic without manually converting to a raster format, or use svg-images. If you do not like using LibreOffice to generate the function graph, then perhaps try GeoGebra and export as svg-graphic from there?

So you’re saying it has to do with anti-aliasing? I tried to remove it here: Preferences… → View → Graphics Output → Use anti-aliasing, restarted LibreOffice and tried to import sin2.png again, but I couldn’t see any changes.
Sure, I can normally export graphs using a variety of different formats, I’ve just tried SVG as you suggested and it looks awesome (less so in presentation mode, but still OK), thanks for your advice, whereas I can see that PDF looks very bad after importing.

This must be related to HiDPI and multi-screen support!

cf.: Blurry image inserted or copy/pasted

I think I may find the reason(not solution yet)!

Just now I did a test, set laptop screen only and with native resolution of 2560x1440 for macOS LibreOffice, copy same source image from website, paste into LibreOffice, voila! same sharp image as original. Also if I save the file, then open with extended Screen_2(1080p), image remain clear!

So it seems LibreOffice uses OS system info to scale/compress the image while pasting into LS.Writer! That means a algorithms of calculation of image size, most probably it has a global value/ratio and a local ratio, if 2 times calculation/resize, the image will be largely compromised thus blurry!

This may be a common issue for macOS/Windows, how to support HiDPI screen and multi-screens with local scaling.