11

When you copy this image

enter image description here

and paste it (via drag and drop from Google Chrome) to Libre Office Writer (4.3.3.2) you get:

enter image description here

Why is this so pixelated / fuzzy?

Somehow it does not copy the original image. How can I tell it to copy it in the original size by default?

But even after setting it to the original size, it is still pixelate. How can I fix that?

4
  • This is also a problem when I insert it as a file from my computer. However, if I include it as a SVG it looks just fine. Commented Feb 21, 2015 at 12:07
  • My guess is that it gets compressed to save space.
    – TheKB
    Commented Feb 21, 2015 at 15:08
  • @TheKB Do you know how to disable it? Commented Feb 21, 2015 at 15:16
  • I don't, sorry.
    – TheKB
    Commented Feb 21, 2015 at 16:11

2 Answers 2

7

This is a known issue in LibreOffice (tdf#86675) where PNG images being imported/inserted and scaled are using "Nearest neighbor" in rendering the document canvas, rather than more common Bilinear, or BiCubic (Catmull-Rom) pixel interpretation on scaling. Also, for now in LibreOffice, believe PNGs with Alpha channel are always "scaled" using nearest neighbor.

Especially an issue on Linux builds, less so on Windows builds.

So, if you can prepare your PNG to the exact size needed, as well as prepare or convert to a non-Alpha channel PNG (using ImageMagick's "convert input.png -background white -alpha remove output.png" or similar utility), you should be able to have acceptable image insertion and rendering in a LibreOffice document.

See: https://bugs.documentfoundation.org/show_bug.cgi?id=86675

3
  • Removing Alpha (in Gimp) didn't work for me. gif, bmp does not work either.
    – Bevor
    Commented Aug 4, 2016 at 19:22
  • It doesn't even work with Libre office 5, what a crap.
    – Bevor
    Commented Aug 4, 2016 at 19:35
  • First of all it looks that it doesn't work either, but when I scale it down inside LibreOffice Calc, it looks good.
    – Bevor
    Commented Aug 4, 2016 at 19:40
-3

Here's a blowup of the original image, ripped from here: enter image description here

You can see clearly that if this is an image in the first place, it's low quality. Blowing it up more with a graphic tool shows it more clearly:

enter image description here

If the first one is an image in the first place, it's originally text data and the font has been smoothed. Because of this the image is not uniformly black and white, but some pixels have grey values. This kind of font smoothing happens everywhere, it's a necessity. Because a pixel is a square, you cannot have any other smooth lines but perfectly horizontal and perfectly vertical, so font smoothing is used to trick viewer's brain.

What causes the pixelation in paste is basically what TheKB says: compression. What you are pasting is a bitmap image, and compression causes loss of image data; you lose grey values. This compression is done by LiberOffice itself.

When you import an SVG, you import a vector graphic. This is a completely different way of producing graphic, those you can upscale without any limitations. A vector graphic will always look exactly the same whether you put it on a stamp or Hoover Dam.

Here's why (simplified version):

enter image description here

The image above shows a simple black square, size 4x18 pixels, color black. If this image is a bitmap, you must specify individually the location and color of each pixel. Let's assume one byte for x, one byte for y and one byte for color and we get 4 x 18 x 3 = 216 bytes of image data.

If this image is a vector, you only need to specify the location of each corner. With these locations you define an area, and color to fill this area. Location is still two bytes for each pixel, but color only takes additional one byte - 4 x 2 + 1 byte = 9 bytes of image data. So a vector image is much simpler than a bitmap.

You didn't put here an example of an imported SVG but if you blow it up it should show pretty much similar to the first image above. LibreOffice will smooth the round and angular lines. However since there's so much less image data, there's nothing to compress.

So what this boils down to is the way LibreOffice handles different image formats. To get your copy-paste look exactly like the original, you need to find out a way to force LibreOffice to paste without loss, 100% quality. Alternatively keep importing vectors.

4
  • This is not an answer. The included image should be as sharp as the original is. This is not the case. Commented Feb 21, 2015 at 14:59
  • Updated. Hopefully the expanded explanation helps you. Commented Feb 24, 2015 at 19:37
  • I know what pixel graphics / vector graphics are. I only mentioned it, because one might suppose another problem. You still don't answer the core question: Why does libreOffice compress the image and how can I deactivate it? Commented Feb 24, 2015 at 19:46
  • "Why LO compresses" - if this is a design, I'm not exactly convinced this is the best place for answers. This could be a bug - did you check LO bug database? Or did you check if current version (4.4) behaves the same way? Have you checked the actual LiberOffice forums, maybe someone has found the answer? Did you check Writer Help file? Commented Feb 24, 2015 at 20:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .