[Solved] Insert image gives poor resolution

Discuss the drawing application
Post Reply
tays01s
Posts: 420
Joined: Thu Oct 28, 2010 7:57 am

[Solved] Insert image gives poor resolution

Post by tays01s »

I'm inserting images into Drawing that originated as .svg files from Inkscape. I originally saved the .svg's as png's but if you change the zoom setting the text becomes jagged despite being saved as 600 dpi. This doesn't occur in Word. However, jpeg appears to work in Drawing.

Am I correct that jpeg is the optical picture type to insert into Drawing and, just for reference, what's the reason for png failing?
Last edited by Hagar Delest on Thu Dec 29, 2016 11:49 am, edited 1 time in total.
Reason: tagged solved.
LO 4.2.2.1 on OSX 10.8.5
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Insert image

Post by Villeroy »

Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
keme
Volunteer
Posts: 3702
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Insert image

Post by keme »

In my experience, the jpg format is the easiest to work with. No problem with png images, except that import/export is slow. I just tested with Draw on a MacBook, and png files take from 10 to 100 times longer to save/load, compared to the same graphic in jpg format (minutes, vs. 1-3 seconds).

You can insert svg images and export to svg. Breaking up an svg into separate elements is a bit flaky. Elements sometimes disappear or move around.

Bottom line: For quick/basic graphics editing where integration in the office suite is important, use Draw. For advanced drawing work and better support for graphics file formats, use Inkscape.
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
tays01s
Posts: 420
Joined: Thu Oct 28, 2010 7:57 am

Re: Insert image

Post by tays01s »

Thanks Keme.
LO 4.2.2.1 on OSX 10.8.5
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Insert image gives poor resolution

Post by John_Ha »

tays01s wrote:I originally saved the .svg's as png's but if you change the zoom setting the text becomes jagged despite being saved as 600 dpi. This doesn't occur in Word.
.svg files are Scalable Vector Graphics files which means they consist of drawing commands like "LINE a,b c,d blue" which is a command to "draw a blue line from (a,b) to (c,d)". If you magnify such an image, it is drawn bigger and it scales perfectly.

JPG, PNG etc files are pixel based files which means they consist of things like "2 blue, 20 red, 11 white ..." which draws 2 blue pixels, then 20 red pixels then 11 white pixels. If you magnify such an image each pixel is drawn bigger (using multiple pixels on your screen) and so you see jagged edges.
tays01s wrote:Am I correct that jpeg is the optical picture type to insert into Drawing
No - that is not the correct conclusion. Any pixel based file such as JPG or PNG etc inserted into Draw will show jagged edges on magnification. If you don't want jagged edges then
  • use vector graphics files like svg (or eps which is Encapsulated PostScript - but you need a Postscriopt printer to print them)
  • if you use pixel based files like JPG or PNG etc then ensure you have enough pixels at the viewing scale you want to avoid jagged edges.
Be aware that JPG files are meant only for photos and nothing else as they use lossy compression where fine detail is lost. Graphics should never be stored as JPG files, and always stored in PNG, GIF or TIF format as they use lossless compression where no detail is lost.

See [Tutorial] Some useful hints on using images for a discussion on using images.

Search Help with svg for more information and read the Draw Guide - V3.3 manual.

In principle, Draw uses vector graphics which is why you can magnify draw objects and you do not get jagged edges. If you put a pixel based file like JPG or PNG into a Draw document it will not magnify well - you always end up seeing the pixels.
Last edited by John_Ha on Fri Dec 30, 2016 2:19 pm, edited 1 time in total.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Insert image

Post by John_Ha »

keme wrote:No problem with png images, except that import/export is slow. I just tested with Draw on a MacBook, and png files take from 10 to 100 times longer to save/load, compared to the same graphic in jpg format (minutes, vs. 1-3 seconds).
keme
I don't see this. I have a 5.9 MByte JPG file and a 5.8 MByte PNG file.

When I Insert > Picture > From file ..., each insert takes maybe 2 seconds. If I drag the JPG or PNG file into Draw each insert is much quicker and is virtually instant.

Are you pasting a photo from the clipboard into Draw (or Writer)?

When I paste the JPG image it appears virtually instantly but when I then Save the file, I get an 8 second delay while Draw compresses the file to PNG. (I have an SSD so disk writes are fast.)

Pasting a photo is strongly deprecated because Draw does not know what format the image is using. The image on the Clipboard is stored in Clipboard format. Draw therefore (correctly) saves the image internally as a PNG file to avoid data loss. If the image is a photo, lossless compressing it to a PNG file takes ages because of all the fine detail and I think this is the delay to which you are referring. Also, the saved PNG file is huge - maybe 3x bigger than the equivalent JPG file.

See [Tutorial] Some useful hints on using images for a fuller discussion.

When testing note that, if you insert the same file twice, AOO saves only one copy in the .odg file, and displays that copy in both locations.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Insert image gives poor resolution

Post by John_Ha »

See attached files. pixels.odg contains some text. I went File > Export ..., and exported it as an SVG file, and also as a PNG file. I then opened the SVG file (clicking on it kicked off Internet EXplorer) and the PNG file (Using IrfanView) and magnified both by about 1200%.

First, note that the text in the Draw file is stored as vector graphics and it magnifies perfectly.

Note how the SVG file magnifies perfectly.
svg file - text scales perfectly at 12x (or any!) magnification
svg file - text scales perfectly at 12x (or any!) magnification
Note how the PNG file, which was visually perfect at 1x magnification, does not magnify well and you can see colour bands and jagged edges. See how each pixel appears as a large square.
png file.  Visually perfect at 1x magnification, large "pixels" giving jagged edges at 12x magnification.
png file. Visually perfect at 1x magnification, large "pixels" giving jagged edges at 12x magnification.
Attachments
pixels.odg
(8.7 KiB) Downloaded 259 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
tays01s
Posts: 420
Joined: Thu Oct 28, 2010 7:57 am

Re: [Solved] Insert image gives poor resolution

Post by tays01s »

Apologies for not picking this up earlier.

John, thanks, v. good info. As you mentioned, .svg lines are perfect when inserted, in this case, into Writer. One residual problem is that the text boxes, laid on top of colour boxes, disappears. I suppose they could be behind the colour boxes I was using to give them a background colour from InkScape.
LO 4.2.2.1 on OSX 10.8.5
User avatar
keme
Volunteer
Posts: 3702
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: [Solved] Insert image gives poor resolution

Post by keme »

tays01s wrote:Apologies for not picking this up earlier.

John, thanks, v. good info. As you mentioned, .svg lines are perfect when inserted, in this case, into Writer. One residual problem is that the text boxes, laid on top of colour boxes, disappears. I suppose they could be behind the colour boxes I was using to give them a background colour from InkScape.
This may be linked to the problem I observed with subordinate objects when you break a grouped object. Try to group everything in Inkscape (so your graphic is a single grouped object) before saving.
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
tays01s
Posts: 420
Joined: Thu Oct 28, 2010 7:57 am

Re: [Solved] Insert image gives poor resolution

Post by tays01s »

It was grouped and I've tried upgrouping, re-grouping just to be sure. Another wrinkle is that if your drawing isn't the full A4 InkScape page, you get a lot of inserted 'white space' as well as the drawing; obviously that's something you'd cut with a jpg, though svg has many other advantages.
LO 4.2.2.1 on OSX 10.8.5
musikai
Volunteer
Posts: 294
Joined: Wed Nov 11, 2015 12:19 am

Re: [Solved] Insert image gives poor resolution

Post by musikai »

In Inkscape you can quickly adjust the page size to a selection: File->Document Properties->Page->Resize Page to Drawing or Selection
Win7 Pro, Lubuntu 15.10, LO 4.4.7, OO 4.1.3
Free Project: LibreOffice Songbook Architect (LOSA)
http://struckkai.blogspot.de/2015/04/li ... itect.html
tays01s
Posts: 420
Joined: Thu Oct 28, 2010 7:57 am

Re: [Solved] Insert image gives poor resolution

Post by tays01s »

Thanks. I should have spotted that.

What about the text box disappearing. I've tried individually grouping the text box with background colour box, but still no joy.
LO 4.2.2.1 on OSX 10.8.5
Post Reply