PNG image is blurry

The following is the sreenshot from a test document with a png image inserted into it:

image

And here is the same image opened in the Windows Photo Viewer (the default program to view images on Windows 7):

image

As you may see, the first image is in fact somewhat blurry, and the second image, which is opened in Windows Photo Viewer, is perfectly fine.

Side-by-side version, just in case:

To see it full-sized, click here: full-sized side-by-side version.

Does anybody know why the image in Writer is blurry?

Things to take into account:

  • There is no difference whether the image is inserted in the document as embed or as a linked file.
  • The image is in the PNG format (and its MIME type is correct, that is, this is really PNG, not a JPG with “png” filename extension). PNG images doesn’t have PPI1, as far as I know. Also, when PPI is wrong, the image is displayed as larger/smaller than it is. But as you can see on the side-by-side version, their sizes seem to be the same. So the blur seems to have no relation to PPI.

1 PPI is often wrongly called “DPI”.

document.odt (123.5 KB)

I use LO 7.2.4.1 on Windows 7.

The images displayed on this site is blurrier than if I download them onto my computer.

Having extracted the image from the .odt file and compared it against the image shown in Writer, the main difference I see is that the image in Writer appears larger. As the display scale (Start menu > Settings > System > Display > Scale) on my laptop is set to 125% I reduced the zoom in Writer to 80% (1á1.25) so the images looked the same size and I could not see any noticeable difference in blurriness.

So I think it is scaling blurriness.

The reason why the images on the website are blurrier than if you download them is may be because the webpage itself doesn’t have enough space on the screen. But I don’t see your screen, so this is just a guess.

If I rename the document to “zip” and extract the image, the image is exactly the same size as the original image. They are also binary same (I have compared them with DiffMerge.)

(This comment doesn’t contradict what you have said; neither it answers my question.)

Also, a user on Superuser.com noted that “PNG files do have a ‘physical size’ in pixels per centimeter stored in the pHYs chunk”. This might be a reason, but again, this is just a guess. The image was created by myself, by using the built-in Windows “Snipping Tool”.

Don’t know if this is related.

Frequently inserting drawings into my documents, I noticed that Writer always shrinks or expands (don’t remember which direction) a few percents the images which causes trouble when you have meticulously adjusted the size to fit as you intend within or aside a paragraph.

This is particularly visible when the drawings have been designed with Draw because you have all the references. But there is no reason it does not happen also with directly inserted images.

I attempted to find the inverse factor to scale the image but it all ended up with more blur. Though there is perhaps an ugly fix:

  • double-click on the image or right-click and Properties
  • go to the Crop tab
  • apply some scale factor like 105%, OK
  • Ctrl+Z to cancel scaling

It looks like this stance improves a bit the caption.

Otherwise, since the drawing is quite simple, make it in Draw and insert it into Writer. This will also clear the background.

1 Like

@jsv1 what percentage is Display set in *Control Panel\All Control Panel Items\Display*? (Windows 7 setting)

It seems that graphics programs ignore the scaling of the display but Office programs scale by the amount shown.

As an example, my display is set to 125%. This means that at 100% zoom in Writer an image at 100% will be 125% larger than the same image in a graphics program. You can check by having the two windows open side-by-side with both at 100%

Below is a screenshot of the the PNG image (100000010000017900000162A20E4D78B79BE324.png) extracted from Writer zip file open in IrfanView (on left) and your Writer document set at 80% zoom (1á1.25). Both images appear the same size and both the same sharpness:

Cheers, Al

It seems the LibreOffice put the image as with dimished DPI to 2/3×DPI. If I enlarged DPI to 1.5×DPI (I use program XnView), then the image is inserted correctly. But I din’t discover how to change the DPI of the image via Libre macro, but opposite way is functional for me → change the Image Size to 2/3 via macro.

Examples:
example-with-macro.odt (56.1 kB)

image1.png with DPI 110
image1

the same image, but with DPI×1.5 (=165)
imageDPIx1.5

As I see, it is only a LibreOffice render issue. If do you export as PDF, you will see the image in the same way that in whatever image editor (not Draw).

Same result if inserting a JPG copy of the original image.

Just see that @jsv1 posted a bug report: tdf#146533.

Elaborating on LeroyG’s identified render issue:

  • The “fast” rendering which LibreOffice uses for active work may take some shortcuts.
  • The “proper” rendering (no shortcuts) should appear when you use preview, export to pdf or actually print the document.

You can try changing the settings for image rendering in the settings dialog (menu item Tools - Options, branch LibreOffice - View). Edge smoothing may cause blur, which masks other rendering artifacts (typically lines which appear jagged, but also other things which may be undesirable).

Those settings will not have a bearing on final product, only on what you see while you work.

EDIT: My remarks do not seem to apply to the current case, but I still leave this comment as a general observation (also not disrupting the comment flow). The sample document displays the graphic as simultaneously both edge-smoothed (blurry) and pixellated (jagged), also in PDF export and print, so the cause here lies elsewhere.

I see both preview and edit windows with the same quality.

I see both preview and edit windows with the same quality.

Then I am mistaken. I didn’t test it on the current sample but took that from memory. Also, my test which I remembered may have been using OpenOffice and not LibreOffice.

I apologise for providing misleading info. I stand corrected. Edited previous comment accordingly.

1 Like