[Tutorial] Some useful hints on using images

Forum rules
No question in this forum please
For any question related to a topic, create a new thread in the relevant section.

[Tutorial] Some useful hints on using images

Postby John_Ha » Tue Dec 27, 2016 2:53 pm

 Edit: Continuously being updated to add information and clarify - some section numbers may change. It has gradually changed into a general discussion about images rather that just how do I minimise image file sizes and has Impress comments. 

It is often best to optimise the images you insert into Writer as large images will dramatically increase the .odt file size. These suggestions are based on minimising the image file size in the .odt file while maintaining the highest sensible quality and are in addition to the information given in Chapter 8 - Working with Graphics in the OOo v3.3 Writer Manual (and Chapter 4 - Adding and Formatting Pictures in the Impress Guide). May I suggest you bookmark the pages.

It is far better to process your images in an image editor so that they are exactly how you want them to appear before inserting them into AOO.

It is strongly recommended that you always work in, and save, all files as .odt files - see See [Tutorial] Differences between Writer and MS Word files for the many reasons. Use .odp files for Impress, not .ppt.

0. It is often useful to switch on the Pictures toolbar

Go View > Toolbars ..., and tick Picture to bring up the Pictures toolbar. The toolbar now appears whenever an image is selected. You can only prevent the Toolbar appearing by deselecting it while an image is highlighted, so select any image so it is highlighted > View > Toolbars ..., and un-tick Picture.

1. Know the difference between a photo image and a graphic image

A photo image is a photo (or a painting).

A graphics image is anything which is not a photo ...

... and is clip art, diagrams, things with large blocks of colour, drawings, logos, line art and anything with text etc. The image below is composite: the left part is photo, but it is overlaid with a graphic. (I had to reduce the quality and pixel count to get it to upload as it had to be less than 128kB).

A photo should always be saved as a JPG file. The term "JPEG" is an acronym for the Joint Photographic Experts Group, which created the standard.

A graphic should always be saved as a PNG (preferably), GIF or TIFF file as these are compressed. A graphic should never be saved as a JPG file as doing so will destroy the image quality, blur edges, make text difficult to read and add artefacts like blotches etc.

Never use BMP for anything as BMP files are not compressed and are huge.

2. Always insert photos by Insert > Picture > From file ..., or by dragging the photo JPG file from your PC (not from the web - see 13) into Writer.

Never insert photos or JPG files by copy and paste. Never - not even once ... but see below.


When you insert a photo JPG file by Insert > Picture > From file ..., or by dragging the photo JPG file into the document, Writer knows it is a JPG file and saves the image as a JPG file in the .odt file: this is the smallest file size possible. If you Copy a photo to the Windows Clipboard and Paste it into Writer, Writer does not know that the image on the clipboard is a photo. Writer therefore (correctly) saves the image as a PNG file inside the .odt document so as to guarantee that no quality is lost. Photos saved as PNG files are likely to be MUCH larger - 3x or 4x larger is typical - than the same photo saved as a JPG file.

You can insert graphics files in any way: by Insert > Picture > From file ..., or by dragging the graphic file into Writer, or by Copy and Paste. Whichever way you choose, they will be stored either as their original file format, or as PNG files if you Copy/Paste.

There is one minor exception to this rule: When you copy an image from an AOO document, presentation, spreadsheet etc; and paste it to another AOO document, presentation, spreadsheet etc; it seems that AOO copies the actual image JPG file or PNG file which is stored in the document. AOO does not appear to do the conventional thing of placing the image on the Clipboard as pixels and pasting the Clipboard pixels.

There is another minor exception to this rule: I was extremely surprised to find that when you paste a JPG into Impress it is saved as a JPG file! I have no idea why it is different ...

3. Know how many pixels you need - camera and phone images are huge so resample them. How do I change the image size on paper?

Images from 6 or 14 or 20 Million pixel cameras are enormous (October 2018 - Huawei's latest phone takes 40 million pixel images!) and ideally need to be processed or re-sampled before inserting them into Writer so as to reduce their pixel count and/or number of colours. Note that it is much better to process images in an image editor and insert the finalised image into Writer. Image editors do what they say on the tin - they edit images. Writer is a word processor - its image editing capability is limited.

How do I re-sample an image?

I use the excellent, free IrfanView image editor/viewer for 99% of my graphics work. It is excellent and I think it has a better re-sampling algorithm than Writer's internal re-sampling algorithm used when creating PDFs. Image > Resize/Resample ..., allows you to reduce the pixel count.

If your document is to be printed ...

... then assume an image will be, say, four inches wide when printed. You need to check with your printer what resolution (in dpi, or dots per inch, where one dot = one pixel) they will be printing at. If they say they will be printing at 150 dpi, where 150 dpi is good quality, 300 dpi is very good quality and 600 dpi is fantastic quality, then the four inch wide image only needs to be 4 inches x 150 dots per inch = 600 dots (pixels) wide. If the image is more than 600 pixels wide (and remember a 6 mega-pixel photo is over 3,000 pixels wide!) then the extra pixels are wasted and they will just clog up the .odt file and make things slower.

So re-sample the image to be 600 pixels wide using an image editor. An image which is 600 pixels wide will have a file which is 25x smaller than the same image at 3,000 pixels wide. Open the image in IrfanView (or any image editor) and go Image > Resize/Resample.

In the image below I re-sampled a 4,320 pixel wide image from my camera (6.8 MBytes, QF = 100) down to 600 pixels wide, which made the file 52x smaller (600/4,320) * (600/4,320) = 51.84x smaller (actually 58x smaller, 118 kBytes at QF = 85).

If your document is intended to be viewed on a PC screen ...

... think about how wide it will be displayed. A 20" display which is 2,000 pixels wide has only 100 pixels per inch so it is completely pointless (no pun intended) to have an image greater than 100 dpi.

If your document is to be exported as a PDF ...

... you can resample the images sent to the PDF by the File > Export as PDF > General > Images ..., dialogue. I have found Writer's resampling algorithm (used when creating a PDF) to produce worse results (spurious lines and bands of colour) than IrfanView's resampling.

The AOO add-on PixCompress will compress all the images in a file. I believe that LibreOffice is shipped with this add-on included.

What size (in inches or mm) is an image when I insert it? How do I change the size?

Image files sometimes contain information about the "size on paper" of the image and this is read by AOO if available. However, once an image is inserted you can left-click it to bring up the green "grab handles" and you then use the handles to drag the image to the size you want. If you hold down SHIFT while dragging, the image keeps its aspect ratio and is effectively magnified or reduced in size. If you mistakenly forget and drag without holding down SHIFT, either press Ctrl+Z to undo the change, or right click the image > Picture > Type ..., and press Original size. This resets the image size. Now drag it to the size you want.

4. Make sure you are using compressed file formats

JPG files use lossy compression where fine detail is lost when the file is saved. JPG is excellent for photos but virtually useless for graphics as it blurs edges, add artefacts like blotches etc.

PNG files, GIF and Compressed TIF (or compressed TIFF) use lossless compression, where no data is lost, and are excellent for graphics. But lossless compression PNG, GIF, TIF are virtually useless for photos as they don't compress the files size much if at all, and they may actually increase the file size compared with JPG - and by 3x or more!

Gif files are typically about 3x smaller than the equivalent PNG or TIF file. This is because PNG and TIF files can store 16 million colours and they therefore use 24 bits to store a pixel. GIF files can only store 256 colours so they use only 8 bits to store a pixel. If you can accept only 256 colours - and, for graphics, there is no reason why not, then GIF is a good format to use. See Item 7 below.

BMP files. Never use BMP as it is not a compressed file format.

5. If image size is still a problem while editing, create reduced pixel count draft images. (Also see using linked, reduced pixel count images in 6 below. Also see 10 below

Stretch the reduced pixel count image to be the same size as the proper image. The image will be recognisable even though the quality will be rubbish, but a 100 pixel wide image file will be 36x smaller than even the 600 pixel file and 900x smaller than the 3,000 pixel image, and Writer will fly while you are editing. When you are finished and ready to publish, replace the draft images with the higher quality images. See the second image below which I re-sampled down to 100 pixels wide - it is only 6 kBytes but recognisable even when stretched to the original size. (Note: If you highlight the original image, and then paste the reduced image; the pasted image is stretched to the exact size of the highlighted image and replaces it precisely).

6. Use linked images instead of embedded images

When you insert an image it can be inserted as an embedded image or as a linked image.

Images are embedded by default so if you drag an image into AOO, or paste (a graphic file!), the image is embedded. If you wish to link an image you must go Insert > Picture > From File ..., and tick the Link box on the file selection pop-up. The tick is sticky.

An embedded image is stored in the document and is therefore always available. The document file is larger because it contains the image files. This is the default for inserting images.

A linked image is not stored in the document - instead the document stores only the location of the image. Whenever the document is opened, Writer goes to that location and gets the image, be it a web page or folder on the PC. If the image is no longer at that location, Writer cannot get it, and only its placeholder is shown. The .odt document file is smaller because it does not contain the image files. You insert linked images by Insert > Picture > From file ..., and ticking the Link box.

If you send a document with linked images to someone else you must also send them the images, and tell them where to store the images on their PC so that Writer can find them and the receiver can see them. Similarly, if you move the document on your PC you must move the images too. For example, you might keep images in a subfolder named Images under the folder containing the document. The recipient of the file needs to put the images in a subfolder with the same name, Images, under the folder containing the document. If you right-click a linked image > Properties > Picture ..., you see the link address. You can use Properties > Picture > Browse button ..., to link to a different image. See Chapter 8 - Working with Graphics for more information.

It is probably much simpler to place the images in the same folder as the document and insert them from there. That way, the images must always be in the same folder as the document and recipients do not need to create a folder to contain them.

You can use linked images to reduce the file size when editing by the following trick:

  • Place all the full size images in a folder called Images and insert an image by linking to the image stored in the folder Images.
  • Now create a second folder of reduced pixel count images with the identical image names.
  • Stop Writer, replace the images in the Images folder with the low resolution images, and restart Writer. Writer will now pick up the low resolution, much smaller images.
  • When you want to see the proper images, put the full sized images back into the Images folder.
Check the OOo v3.3 Writer Manual for information on using linked images.

I prefer always to embed images in the document as they are then always available.

Are my images linked or embedded? How do I convert my linked images to embedded images?

If you want to check whether any images are linked, go Edit > Links ..., which shows which images are linked. If your images are linked Edit > Links > Break link ..., allows you to break the link(s) and embed the image(s) in the document.

7. Use 256 colour (8 bit) images instead of 16 million colour (24 bit) images if possible

If your images permit it, convert them to 256 colours (or greyscale for black and white) because the file sizes will be 3x smaller again. Change the colour depth in IrfanView by Image > Decrease colour depth.

You can do this for photos (JPG) where the difference is often almost impossible to see.

You can also do it for graphics images but you sometimes get strange effects when you reduce the number of colours. This is because image editors like IrfanView are primarily designed for photos, and the method used to reduce the number of colours is non-linear - it emphasises the most used colours in the image and can eliminate less used colours completely. This is exactly what you want for photos, but it often has strange effects for graphics where you can get a green cast over the white in the image, and/or some colours can disappear completely. If this happens, just save the graphic as a .GIF file. GIF files only store 8 bit (256 colours) - they cannot save 24 bit images - and the IrfanView colour mapping from 24 bit to 8 bit is linear, giving excellent results.

8. Choose an appropriate Quality Factor when you save a JPG photo

When you save a JPG file (in IrfanView and other editors) you can choose the Quality Factor for the file (0 = worst, 100 = best). The higher the QF, the better the quality of the image BUT the larger the file. QF = 85 is a good compromise for normal photos, 90 to 95 might be necessary of you have very fine detail in the photo, or a composite image with photo and text. JPG images from my camera seem to have been saved at QF = 100 as saving them at QF = 85 reduces the file size enormously.

9. Increase the size of the AOO Graphics Cache

The default value of the Graphics Cache is only 20 MB (AOO 4.1.3). PCs have much more memory these days, so it is well worth while increasing it to 200 MBytes (256 MBytes is the maximum) as shown in the image below. Tools > Options > OpenOffice > Memory ...

10. Turn off graphics display

It may also help to turn off graphics display: Tools > Options > OO Writer > View > Display > Graphics & Objects: OFF

The images are not brought into the document while you are editing the text and show as empty rectangular placeholders labelled "graphic". The images are shown in File > Page Preview ..., and are printed when you print the document or create a PDF. [Thanks to acknak]

11. Learn about Anchor and Wrap options - get it wrong and your images will keep moving :crazy:

When you insert an image into Writer it is always anchored to something. Right-click an image > Anchor ..., and you see the Anchor options, where you can Anchor to the page, Anchor to a paragraph, Anchor TO a character or Anchor AS a character.

Writer uses Anchor TO a paragraph as the default option when you insert an image by dragging it into Writer, by going Insert > Picture > From file ..., or by pasting (a PNG!) image.

An image is anchored to a location based on, but not necessarily at, wherever the cursor is located when you insert the image.

When you insert an image it uses the default Anchor to a paragraph so the anchor is located at the start of the paragraph in which the cursor is located when the image is inserted. If the paragraph is empty the anchor is located at the empty paragraph.

If the paragraph begins on a previous page the image will be located on the previous page anchored to the paragraph start. Be careful if you are using new lines instead of paragraph returns (you should not for many reasons) because the start of the actual paragraph may be a long way away. A new line does not create a new paragraph.

If you move the item to which the image is anchored, the anchor and hence image moves with it; if you delete the item with the anchor, the anchor is deleted and so is the image.

Anchor AS a character gives the least flexibility for locating the image, but gives very stable image location because the image is treated as "a big, special character". If you Anchor AS a character after the " a " in the word "cat", the image will always be located " c a [image] t". Obviously, you cannot Wrap text around an image Anchored AS a character. See Help and the manual for more information.

I prefer the default Anchor to a paragraph for all my images, where the anchor is located at the start of the paragraph and I always make sure that the image is located close to (say, within a few lines) the start of the paragraph containing the anchor. Note that dragging an image will cause the anchor to jump to the next appropriate available place. When the anchor is where you want it to be, fine-tune the image location to position the image. If the paragraph is very long you may need to insert a redundant new paragraph just so that the image and its anchor are close together. Make sure the Anchor is on the same page as the image.

Images keep moving or layout keeps changing or white gaps appear or page numbering increases - what is happening?

Occasionally, if an image in anchored to a paragraph, and the anchor is poorly located, Writer can get into a loop for several (or more) seconds.

What seems to happen is that Writer tries to position an image on, say, page 4. There is not enough space for the image > so Writer spills some text to make room for the image > the spilled text takes the image anchor with it > which pulls the image down to page 5 > which leaves a gap on page 4 > so Writer pulls up some text to fill the gap > which pulls up the image anchor > which pulls up the image > but there is not enough space for the image > so Writer spills some text > which takes down the anchor ..., and so on ad infinitum. Writer eventually drops out of this loop with the image located where it was positioned when Writer pulled out and often a white space gap is left in the text. This is particularly noticeable when using Master Documents where the entire document is laid out each time the document is opened or updated.

While not related to images, this "layout problem" can also happen with footnotes for the same reason - see [Solved] AOO stops responding when opening this one document.

How do you stop it happening? You need help Writer to layout the pages. First, ensure that your image is close to its anchor. If your paragraph is long and the image is a long way from the anchor add a redundant new paragraph for the anchor to use. Try adding an extra, redundant paragraph break (or breaks) or redundant page break(s) so as to stop the spilling, or to force the spilling. But don't forget that, if you add or delete text before where the problem is, you might cause it to happen again. Change the anchor to page or character.

Wrap options

Similarly, right-click an image > Wrap ..., and you see the options which allow you to control how the text flows round the image, is prevented from flowing round the image, or is allowed to flow over the image.

No wrap means that the text ends above the image, and begins again below the image.

I find Optimal Page Wrap the most useful as the text now flows round the image. It is best to right-click the image > Picture > Wrap ..., and set gaps between the image and the flowed text.

Wrap in background allows you to overtype text on top on the image.

right-click an image > Picture > Type ..., gives many options and, for example, allows you to type the position offsets which is very useful to nudge the picture small distances; or accurately align or size more than one image; and set a gap between image and flowed text.

See Chapter 8 - Working with Graphics in the OOo v3.3 Writer Manual for a full description of the options available in Writer and Chapter 4 - Adding and Formatting Pictures in the Impress Guide for a full description of the options available in Impress. May I suggest you bookmark the pages.

12. Inserting multiple images - why do they all stack up like crazy?

Remember that when you insert an image it anchors to the start of the paragraph where the cursor is located. So, if you insert multiple images without moving the cursor between images, all the images will use the same one anchor location.

Say, for example, you create a new, empty document and then insert three images. Remember that, by default, images are inserted as Anchored TO a paragraph. As there is only one (empty) paragraph in the new document, all three images will be anchored to it, and all three images will overlay each other. If you now drag some images to the next page, these images are then a long way from their anchor. This is a sure recipe for endless frustration and confusion; and for random moving and even losing images. It is much better to put in lots of empty paragraphs (press Enter multiple times) and anchor each image to its own, nearby paragraph. Be sure to anchor each image to its own anchor. Do not anchor more than one image to any one anchor location.

It is also very easy inadvertently to delete a highlighted image by inserting another image while the first is highlighted. The new image promptly deletes the highlighted image and takes its place (and resizes itself to be the same size as the replaced image).

13. Copying and pasting text and images from the internet - the images don't appear or things go funny

The best way to use images from the web (copyright permitting) is to download and save the image file (JPG, PNG etc) on your PC and insert the file as normal. Alternatively, take a copy of the image and paste the copy into an Image Editor like IrfanView as this strips any associated web coding. Save the image as a PNG, GIF, JPG etc as appropriate and insert the saved PNG, GIF or JPG image file as normal. If you don't you are likely to run into some problems.

First, never drag images from a web page into Writer as the results are unreliable and browser dependent. There is a bug in Firefox which means that all images dragged from the web are stored in the .odt file (AOO) as huge BMP images. A test shows that dragging a typical 3,264 x 2,448 pixel JPG, which is 2.96 MBytes as a JPG, stores the image as a 32 MByte BMP. As a BMP of a photo compresses poorly, the .odt file with just the image and nothing else is a staggering 15.8 MBytes. Downloading the JPG file first and then dragging it from the desktop is fine - it gets saved as a 2.96 MBytes JPG file inside the .odt.

Second, if you copy and paste images from the internet they are often inserted as linked images, which means that only the location of the web image is stored in the document. Each time the document is opened, the document goes to that web page and pulls down the specified image. If you are not connected to the web, or if the site is down, or if the page has been changed and the image removed, the images cannot be pulled down and are not displayed. But you read Points 1 and 2 so you won't be pasting any photo images, will you ...

Third, you will often find that if you copy "a range of text including some images" some or all of the images do not paste into the document, or things "go funny". This is because there are different ways to code a web page to display an image, and some of those methods do not survive the copy/paste. It is far better practice to download the images to your PC, process them, and insert them in the document that it is simply to "paste what was on the web page". Right-click the image > Save image as ..., and save the image (photos as JPG, others as PNG). Now insert the saved image. Similarly, copy the text and strip all formatting during the paste by Edit > Paste Special > Unformatted Text.

14. Rotating images

You cannot rotate an image using Writer. Either open the image with an image editor like IrfanView, and rotate it there; or copy the image into Draw, and rotate it there. Strangely, you can rotate an "image copied from Draw" in Writer by right-clicking the image > Position and size > Rotation ..., and set the angle. Presumably the copied image brings in the rotate attribute? from Draw and you now have access to changing it.

15. VERY important. Do not be too quick in slamming the laptop lid shut after saving the file

Give AOO plenty of time to close gracefully, and to save the file properly, and then to save the profile file (which is the last thing it does). When you close a file, AOO continues to save data for several seconds after the blue dotted bar has stopped. An AOO file of 80 MBytes takes a LONG time to write - several (many?) seconds. Long save times are very noticeable if you save to a network disk where it can take 30 seconds or more on a slow network.

There is some evidence to suggest that problems arise when people either slam the laptop lid shut while the file is still being written, or else say "Oh! I forgot to ...", and then try to open the file which is still being saved. And, of course, always eject any USB memory stick properly to ensure any cached data is moved to the USB memory.

16. Lost images ... and a word of caution about using AutoRecovery. LibreOffice 6.1 may now be better than AOO

Case 1: A silly but common reason for losing images occurs when many images share the same anchor location as in 11 and 12 above. Make certain that each image has its own anchor] and make certain that each image is positioned close to its anchor and not, for example, on a different page.

Case 2: There is a problem with AOO (and with older versions of LO) where images occasionally get lost. The most common reason seems to be when many large images are inserted - I have seen it happen on adding over 50 x 1.5 MB images. You scroll up through the document and find that images are missing, or you open a saved document and images are missing. It seems to be random and with no apparent cause.

Recommendation. Lost images cannot be recovered so always keep of separate copy of any images you insert just in case you lose them from the file.

 Edit: LO 6.1 has recently (2018/2019) rewritten the image handling code to prevent image loss and LO may therefore now be better than AOO. LO spent 40,000 Euros on having a professional programmer rewrite the image handling code so it was probably about six person-months of work.

See Image handling rework for LibreOffice – Collabora’s tender results (June 2018),
How TDF uses its tendering process to improve LibreOffice and share knowledge with the community,
Has LibreOffice 6 just killed the indispensable "Memory" options? and
Bug 110448 - Remove "Memory" page from Options dialog; only adjust the settings using Expert Configuration


Case 3: Another, extremely rare case is using AutoRecovery, where if you set AutoRecovery to, say, five minutes, then Writer saves your document in a temporary file every five minutes to protect you from PC crashes etc. I normally recommend that people set AutoRecovery to ON by Tools > Options > Load/Save > General ..., and I have it set to ON on my PC. However, there are some extremely unusual cases where some or all of the images in a file are lost. I have witnessed this happening at completely random times (Case 2), and also at the precise moment at which the AutoRecovery takes place. Strangely, it seems to be file dependent and, while it can be replicated on specific files, it never happens on other almost identical files. I have raised a bug report with an example file where the images are lost when AutoRecovery takes place.

So what do I recommend? The three most important things to do are backup, backup and backup. And keep backup copies of files you insert. See the Timestamp Backup extension which is designed for LO but (2018) works with AOO. When you use it, every time you save your file, you save it as normal but, in addition, you save a time stamped version of it in a separate backup folder. You need to delete older versions in the backup folder yourself.

After that, then be aware of it. If you have a lot of images in your document where losing them would be a major headache, then take special care. Perhaps split the document into smaller documents, where each has a manageable number of images if you lose them - rerplacing them will not be a major task. Keep original copies of your images in case you do need to replace them. You could switch off AutoRecovery and train yourself (or get a reminder utility) to save the document frequently while you are editing it.

 Edit: If you are using AOO then making the following adjustments in Tools > Options > OpenOffice > Memory ..., may reduce the probability of image loss by minimising the risk that images are moved from memory to disk. Note however that LO has removed these settings from casual user change and placed them in Advanced Settings.

1. Minimise the images file size (ie MBytes as stored in the AOO file) - see this tutorial. It is the size of the JPG file (not pasted!!) or the PNG file.
2. Set the Graphics cache to 255 MB - it is the maximum allowed
3. If the maximum image file size is 1.5MB, then set Memory per object to 1.6 or 2.0 MB - this allows more images to remain in memory
4. If you set Memory per object to 2MB in 3. above, set Number of objects to 255/2 = 127 images.

That maximises the chance of all images staying in memory and none being swapped out to disk.

You may find that using linked images is better because it may be that, whereas you lose the image, you keep the link. If so, reopening the file should get the images back. But judging by what happens to content.xml when an image is lost I think you will lose the link as well. If you want embedded images in the final document just break the links when the document is complete - this embeds the images (see Section 6 above) 

Go Tools > Options > Load/Save > General > Always Create Backup Copy ..., as this creates a backup copy of the file as it was when you opened it and saves it in the Backup folder (the default is C:UsersxxxxxAppDataRoamingOpenOffice4userbackup). The backup is not overwritten if, while editing, you Save the file but, if you close the file, the backup copy is overwritten when you next open the file.

If you do lose your images while you are editing the file, you can at least save your image-less file with a new name. Now open the backup file, and then copy the new text into it. Be careful not to save the image-less document under its original name as this will overwrite the backup if you re-open the image-less document. Do some tests to ensure you understand when you will over-write your backup copy so that, if you get a problem, you don't overwrite it before you need to use it!

composite.png
Using IrfanView to re-sample a photo from 4,320 pixels wide (jpg = 6.8 MBytes) to 600 pixels wide (jpg = 0.12 MBytes).
Note: the image shown has reduced quality to allow it to be uploaded here

image.jpg
Original photo resampled to 100 pixels wide is only 40 kBytes.
Image stretched in AOO to 4x larger is blurred but easily recognisable
The 100 pixel image is 150x smaller than the original photo (40kBytes compared with 6MBytes).
Reducing the QF or reducing the number of colours would make it 500x smaller without any significant further change.

graphics cache.png
Reset graphics cache to 200 MB or more
Last edited by John_Ha on Tue Oct 15, 2019 4:22 pm, edited 70 times in total.
AOO 4.1.6, Windows 7 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: 6812
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Tutorial] Some useful hints on using images

Postby Hagar Delest » Wed May 10, 2017 6:32 pm

In addition to IrfanView, there are also:
- XnViewMP, equivalent to IrfanView. It is Multi-Platform, very good looking and efficient. Available in many languages.
- GIMP, which is an image editor (equivalent to Photosop), useful to improve pictures very precisely.
AOO 4.1.6 on Xubuntu 19.04 and 4.1.5 on Windows 7 (with winPenPack port).
User avatar
Hagar Delest
Moderator
 
Posts: 28560
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [Tutorial] Some useful hints on using images

Postby John_Ha » Sat May 20, 2017 12:00 pm

Other free Image Editors include (though there are many!)

- paint.net and
- FastStone Image Viewer (Faststone has a fantastic Heal tool which clones while taking account of the texture - it is truly magic)

Both are similar to IrfanView, in that they are powerful, but much easier to use than the much more comprehensive GIMP (free), and PhotoShop.
Last edited by John_Ha on Fri Apr 13, 2018 3:48 pm, edited 2 times in total.
AOO 4.1.6, Windows 7 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: 6812
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

How to use a shape to frame an image

Postby John_Ha » Thu Oct 19, 2017 11:34 am

This is based on this post [Solved] Framing Images with Shapes

1 Download a suitable heart image.

2 Download a suitable image editor - I use the free and excellent IrfanView and edit the heart image.
- Image > Decrease colour depth ..., to reduce the image to two colours - black and white (this avoids the "black edge" line you otherwise get)
- Image > Negative ..., to invert the colours so the heart is black and the background is white
- Image > Resize/Resample..., to, say, 500 x 500 pixels
.
3 Save As ...
- choose PNG >>> you must choose PNG here because PNG supports transparency.
- click Transparency > choose the black heart shape as the transparent colour.

You now have a 500 x 500 pixel heart shaped "mask", where the heart shape is transparent, and the background border (in my image) is white. Note how in the image below, the heart is transparent and therefore shows the page blue background.

heart.png
heart.png (1.73 KiB) Viewed 22713 times

4 Open the cat photo with IrfanView
- Image > Resize/Resample..., to, say, 500 pixels high - ie similar to the heart mask as pixel overlays pixel
- Edit > Insert Overlay/Watermark..., and navigate to heart.png
- Click Preview..., and adjust the mask position etc as required. I didn't make any adjustment - I should have lowered the cat a bit.

5 Save. You can save it as any format - JPG, PNG etc - because you do not now need transparency. However, you must save the transparent mask as a PNG file in Step 3.

cat.jpg

cat in heart.jpg

Note: The example image quality is poor so as to keep the file sizes small. The original heart image was 2,000 x 2,000 pixels and the heart was red.

You will appreciate the simplicity of doing this with software which is designed to do it. Writer is, unsurprisingly, primarily a text editor, and not an image editor. That is why I stated that users are strongly recommended to do all their image processing using a good image editor before loading the completed, final image into Writer.

The forum places the image files as in-line images, not download files - see the ZIP file in the next post for all three files.
Last edited by John_Ha on Mon Dec 18, 2017 9:04 pm, edited 2 times in total.
AOO 4.1.6, Windows 7 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: 6812
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

How to use a shape to frame an image - files

Postby John_Ha » Thu Oct 19, 2017 11:36 am

These are the image files - download and double-click the file to extract them.
Attachments
mask files.ZIP
(77.81 KiB) Downloaded 184 times
AOO 4.1.6, Windows 7 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: 6812
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Tutorial] Some useful hints on using images

Postby erbsenzahl » Sun Oct 29, 2017 12:42 pm

... I only did it on Draw, heart shaped tomcat*.

CatInHeart.jpg


* It's because of our beloved tomcat at home, named Ratzinger. ;)
OpenOffice 3.4.1 and 4.1.7 on LinuxMint 19-64 Mate, rarely W7-64 pro and W10-64 pro; LibreOffice current versions
(author is no native speaker)
erbsenzahl
Volunteer
 
Posts: 143
Joined: Tue Apr 18, 2017 8:23 am
Location: Germany

Re: [Tutorial] Some useful hints on using images

Postby phs » Fri Feb 16, 2018 11:47 am

Never insert photos or JPG files by copy and paste. Never - not even once


Do copy and paste if you want the JPG to appear in the document in its original size; then drag and replace the image to reduce its size, as recommended above.
OpenOffice 4.1.2 on W7. Native English speaker.
phs
 
Posts: 1
Joined: Fri Feb 16, 2018 11:42 am

Re: [Tutorial] Some useful hints on using images

Postby John_Ha » Tue Feb 20, 2018 6:13 pm

phs wrote:[Do copy and paste if you want the JPG to appear in the document in its original size; then drag and replace the image to reduce its size, as recommended above.

No.

Read the tutorial. Copy and pasting JPG files stores them as huge PNG files within the document. That is why you should not do it.
AOO 4.1.6, Windows 7 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: 6812
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK


Return to Writer

Who is online

Users browsing this forum: No registered users and 3 guests