[Solved] Compressing size of an odt containing large images

Discuss the word processor
newbie13
Posts: 6
Joined: Sun Jan 10, 2016 1:36 pm

[Solved] Compressing size of an odt containing large images

Post by newbie13 »

Hi all!

I'm new to the forum, this being my first post.

Could someone please explain how to compress an integral odt document containing high res/large image files?
I've scanned this forum and found other threads in which users advise to remove visuals, reduce the size in a photo editing software and then re-insert -- but that seems like quite a hassle.
--> Is there a way of simply compressing the entire document (currently close to 55MB) so that it can be sent via email? Word has such a function, surely OO must too.

Thanks so much in advance for any help!
Last edited by newbie13 on Sun Jan 10, 2016 6:54 pm, edited 1 time in total.
OpenOffice Apache 4.1.1 with MacOS X 10.9.5
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: help w/ compressing size of an odt containing large imag

Post by acknak »

For presentation documents (slide shows), there is a "minimizer" extension available that reduces file size by making embedded images smaller, but it's not available for OO Writer documents: they have to be managed manually.

You can do it as a batch process if you're willing/able to work at a command line. You need some sort of batch image processing package, such as ImageMagick: www.imagemagick.org
AOO4/LO5 • Linux • Fedora 23
User avatar
RoryOF
Moderator
Posts: 34617
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: help w/ compressing size of an odt containing large imag

Post by RoryOF »

If the files are stored in .odt format, they are already compressed. The files in your document do not need to be at any higher resolution than the eye can resolve in the finished print; this is generally understood to be 180 - 210 dpi on the finished page.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
newbie13
Posts: 6
Joined: Sun Jan 10, 2016 1:36 pm

Re: help w/ compressing size of an odt containing large imag

Post by newbie13 »

Hi and thanks for your suggestions!

As mentioned, the .odt file containing images and text (not a slide show) is roughly 55MB and, ideally, I'd like a solution in which the entire document can be compressed so that the overall size is reduced. The images can be 72dpi or even lower, that doesn't matter (they currently seem to be 300 dpi) -- the file was sent to me like this and I am editing/rewriting the copy, so the quality of the visuals is not important.
Again, I'd like to simply compress the file as whole, rather than size down the individual images and then re-insert into text. From the two comments above, I take it that there currently isn't an option for reducing the overall file size when working with Open Office.
Re:
"You can do it as a batch process if you're willing/able to work at a command line." Unfortunately, I have no experience with this.

Any last suggestions before I give up on this?
Thanks so much in advance!
OpenOffice Apache 4.1.1 with MacOS X 10.9.5
User avatar
RoryOF
Moderator
Posts: 34617
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: help w/ compressing size of an odt containing large imag

Post by RoryOF »

An .odt file is already compressed; recompression of a compressed file may actually increase the size. Use of a different compression may make a slight adjustment, but of a trivial amount; the problem with that, if it were possible, is that the .odt file now becomes non-standard.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: help w/ compressing size of an odt containing large imag

Post by John_Ha »

Also, see Re: Images for some more information about images in Writer.

Use the free IrfanView to resample the images to a reduced pixel count, to reduce colours (256 colours is 3x smaller than 24 bit colours). Never insert JPG files by pasting as they get saved as (much bigger) PNG files.

For - unsupported! - speed, unzip the .odt file, look inside Pictures and batch process (IV does it) the images there to reduced pixel counts and/or reduced colour counts. See Using 7-ZIP and Inside an odt file

If this solves the problem, please click the Edit button on your original post and edit the Title to [Solved].
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.
newbie13
Posts: 6
Joined: Sun Jan 10, 2016 1:36 pm

Re: help w/ compressing size of an odt containing large imag

Post by newbie13 »

Sorry if I'm being daft about this everyone, but what I've gleaned from all of your comments and suggestions is that it isn't possible to do what I want and need to do with OpenOffice. With MS Word, there's a simple solution to reducing the overall size of hefty documents (so that they can be sent via email, for e.g.). This is what I would like to do using OpenOffice, rather than editing the images and re-inserting into text. Apologies for repeating myself but I'm not much of a techie and a new OO user to boot.

PS The unzipping option looks a bit too complex for me, unfortunately. But surely a great suggestion for someone who's more surefooted in the field.
OpenOffice Apache 4.1.1 with MacOS X 10.9.5
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: help w/ compressing size of an odt containing large imag

Post by John_Ha »

Writer does not have the capability to do this automatically to a .odt (or .doc) file.

It is almost always better to do all graphics processing in an external graphics editor and bring the final image into Writer.

If you want to create a PDF by File > Export as PDF you have the option to compress image sizes there.
Attachments
Clipboard01.png
Last edited by John_Ha on Sun Jan 10, 2016 5:17 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.
User avatar
RoryOF
Moderator
Posts: 34617
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: help w/ compressing size of an odt containing large imag

Post by RoryOF »

It is certainly not possible to do in an easy and fool-proof method. One could perhaps unzip the file, copy out the images folder (not certain of the exact name) and replace it with a modified copy, where the resolution of all the images has been drastically reduced, perhaps by the batch method acknak suggested earlier. When the file had been finally edited, the images folder could then be restored with the original.

An easier, but slower method than sending the file by email is to edit the original as is, then send that by conventional snail-mail, be it on a CD/DVD or on a USB key.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: help w/ compressing size of an odt containing large imag

Post by Villeroy »

ImageMagick for the Mac: http://www.imagemagick.org/script/binar ... php#macosx
Reduce resolution of all jpg in current directory to 50%:

Code: Select all

mogrify -resize 50% *.jpg
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
RoryOF
Moderator
Posts: 34617
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: help w/ compressing size of an odt containing large imag

Post by RoryOF »

While you note that MS Word has a method of doing such compression, remember that normal MS Word .doc files can be very much larger than OO Writer .odt files of the exact same content, so you are already enjoying the compression.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: help w/ compressing size of an odt containing large imag

Post by John_Ha »

newbie13 wrote:PS The unzipping option looks a bit too complex for me, unfortunately.
 Edit: These instructions are for Windows, not Mac (although I am sure the equivalent function is available on Macs with similar free utilities) 
Try it (on a copy of the .odt file just in case) and find out. You will learn a lot and discover that it is actually very simple. Get the images out. In IrfanView go File > Batch conversion/Rename > navigate to the files, add them to the pane below, and set the conversion required. Save the results in a separate folder otherwise IV will overwrite your files and, if you make a mistake, you have lost them. Put the files back. All done!

You have been given all the information you need so, please, just try following it. You have nothing to lose but your time. We don't have the time to spoon-feed each individual step of the process.

Note to volunteers: It would probably be pretty simple to write a macro or extension to do that!

 Edit: See Mr Dandy's post below - there is an extension called PixCompress which does what is required 
Last edited by John_Ha on Mon Jan 11, 2016 12:38 pm, edited 2 times 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: help w/ compressing size of an odt containing large imag

Post by John_Ha »

OK - you can do it in Writer with a bit of work!

1 FIle > Export as PDF ... and set the settings
2 create the PDF.

The PDF contains all the resized images. Now just put them back. But you must drag them back, not paste them back, if you want the sizes reduced.

3 Open the pdf, left click the first image > right click it > copy image. This puts the reduced image on the clipboard
4 paste into a graphics editor > Save as a jpg file
5 go to that image in Writer > left click it to highlight it (green handles)
6 drag the JPG file onto the highlighted image - this replaces the image
7 go to Step 3 above until all images are done.

If this solves the problem, please click the Edit button on your original post and edit the Title to [Solved].
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.
newbie13
Posts: 6
Joined: Sun Jan 10, 2016 1:36 pm

Re: help w/ compressing size of an odt containing large imag

Post by newbie13 »

John_Ha wrote:
Note to volunteers: It would probably be pretty simple to write a macro or extension to do that!
I know that there are a lot of writers and editors like myself who would be deeply grateful if someone resolved this issue :)

And to everyone else: I didn't get the answer I was hoping for (i.e. that the same function for resizing integral documents I use in MS Word also exists for OpenOffice), but all of your help and suggestions are greatly appreciated. Will mark this topic as "resolved" as per your requests.

Thanks all, and have a good Sunday evening or day, contingent on where you're located.
OpenOffice Apache 4.1.1 with MacOS X 10.9.5
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Compressing size of an odt containing large ima

Post by John_Ha »

newbie13 wrote:I know that there are a lot of writers and editors like myself who would be deeply grateful if someone resolved this issue
As a matter of interest, why does the size of the .odt file matter to you? Is it because you send it to someone? Or for what other reason? Or because you have lots of images?

What I recommend for books is to use small, poor resolution images in the text as it reduces the .odt size while working on it, and the .odt will never be used for production. Replace the poor images with good ones when you need to craete the PDF.

Also, books are best edited using a Master Document, with one sub-document per chapter. Fle sizes are now small. See Ch13 - Working with Master Documents and Creating and Using Master Documents
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.
newbie13
Posts: 6
Joined: Sun Jan 10, 2016 1:36 pm

Re: [Solved] Compressing size of an odt containing large ima

Post by newbie13 »

John_Ha wrote:
newbie13 wrote:I know that there are a lot of writers and editors like myself who would be deeply grateful if someone resolved this issue
As a matter of interest, why does the size of the .odt file matter to you? Is it because you send it to someone? Or for what other reason? Or because you have lots of images?
Hi John_Ha,
newbie13 wrote:
As mentioned, the .odt file containing images and text (not a slide show) is roughly 55MB and, ideally, I'd like a solution in which the entire document can be compressed so that the overall size is reduced. The images can be 72dpi or even lower, that doesn't matter (they currently seem to be 300 dpi) -- the file was sent to me like this and I am editing/rewriting the copy, so the quality of the visuals is not important.
In a nutshell: I'm a writer and editor and sometimes receive text files from clients containing images, and said files are massive because the client hasn't sized them down (their bad). I simply want to write copy/edit existing copy, maintaining visuals for layout purposes, but would like to circumvent resending such massive files as, due to tight deadlines, I always send content via email, never by snail mail as someone suggested above. Hmm, perhaps I should've mentioned this in my original post, might've made things clearer for everyone. Apologies!

I hope this answers your question and thanks again for all the help :)
Here's to some wonderful developer creating a tool/function/add on that will mimic the MS Word compressing/re-sizing function! :)
OpenOffice Apache 4.1.1 with MacOS X 10.9.5
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: [Solved] Compressing size of an odt containing large ima

Post by Mr.Dandy »

OpenOffice 4.1.12 - Windows 10
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Compressing size of an odt containing large ima

Post by John_Ha »

It must be Christmas because your wish has been granted - as Mr Dandy says, there is indeed an extension PixCompress to do it. I had forgotten all about it - I actually tested it some time ago. That's "advancing years" - a memory with all the characteristics of a sieve!

Also, there are various web sites - including Dropbox - where you upload the file, and send a link to it so the file does not get sent as part of the email. Some email systems limit files to 25MB.
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.
newbie13
Posts: 6
Joined: Sun Jan 10, 2016 1:36 pm

Re: [Solved] Compressing size of an odt containing large ima

Post by newbie13 »

Thanks everyone, I've installed the extension and applied it to the document in question but it's still just under 55MB. Curious and curiouser...
I use websites such as Dropbox and WeTransfer for hefty files too :)
OpenOffice Apache 4.1.1 with MacOS X 10.9.5
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Compressing size of an odt containing large ima

Post by John_Ha »

If you create a small document - say about 10MB - with some of the images, and post it somewhere, I will look at it for you. I have sent you a PM with my email address.

If the file has confidential material in it, you can obscure the contents without greatly affecting the structure by changing every alphabetic character to an " x ", and every digit to an " n " with

Edit > Find and Replace
Tick Regular expressions (under More ...)
Find box [:alpha:]
Replace box x
click Replace all

and

Find box [:digit:]
Replace box n
click Replace all
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.
serenejean
Posts: 18
Joined: Wed Jan 22, 2014 3:41 am

Re: [Solved] Compressing size of an odt containing large ima

Post by serenejean »

I have the same problem with file size.
Mine is a Writer file where I've copied & pasted interesting technical information, including large images, from websites over many many years. Now it has come to the point where it takes 5 minutes to save and is extremely slow to move from page to page. I don't want this document to be a .pdf file or in a zip folder or divided into parts, as I'm adding to it almost daily. It's my reference book.
Is there something like 'placeholders' for the images (Pagemaker had such) which would make it more manageable for moving thru sections, where you 'turn on' the image when it needs to be inspected?
Alternatively I'd be happy to globally reduce all the .jpgs by 50%. Is there a command line code for that and how to start off? Or how to reduce the number of colours for just that file?
Thank you for any help.
OpenOffice 4.1.1, Windows Vista
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Compressing size of an odt containing large ima

Post by John_Ha »

First, read the rest of this thread and especially see the PixCompress add-on.

Second, and working on a copy of the file in case you mess things up, you can process the images stored in the .odt file. Note this is not a "supported" way of working, but it should work.

1 Unzip the .odt file with an unzip utility - it will look like this.
Clipboard01.png
2 Look inside the Pictures folder - it will look like this.
Clipboard03.png
Extract the pictures, process them, then put them back. Make absolutely certainly you do not change their names or their qualifiers in any way. Reduce sizes by resampling (to reduce the number of pixels), and using, say, 150 pixels per inch as a good quality value; and by reducing the number of colours (to 256 or even 16 for graphics, and to greyscale for mono images). The free IrfanView Image Viewer/editor will do both these.

You might also check if any photos, which should be stored as JPG files were pasted in, in which case they will be stored as much bigger PNG files. Open the document as normal with Writer and remove them, save them as JPG files, and drag - NOT Paste - them back in; or use Insert > From file > Picture ... You must NOT replace, say, fred.PNG file by fred.JPG file when you unzip the .odt file as Writer will not recognise the image and you will get a File damaged error message.

Third, if you have been editing the file a lot, it would be well worth while to copy the contents to a new file as heavily edited files can get "tangled". Again working on a copy:

1 Edit > Select all
2 Edit > Copy
3 File > New > Text document
4 In the new document go Edit > Paste.
5 Save the new document.

Have you thought of splitting the file into several sections, like chapters in a book; using a Master document to call up the sub-documents, where each sub-document is a "chapter"? See the up to date Writer guide and/or the OOo v3.3 Writer Manual for assistance on Master documents.

Save the original file somewhere safe just in case you find out in a few weeks time that something went wrong.

Fourth, you can switch off viwing the images by TOols > Options > OO Writyer > View > untick Duisplay graphics and objects.

Fifth. It's a bit clunky, but you could change all the images from "embedded and stored in the .odt file" to "linked to images stored in a folder", where the images are stored in a separate folder associated with the document. Now have two versions of the folder - one with high resolution images for when needed, and one with low resolution images - ie much faster browsing - for when quality is not needed. See the manual chapter on Working with images for details of linking.

Be sure to keep a completely copy of the file as there have been occasional reports of users losing images from files. You may also want to set Create A Backup copy to ON as this keeps the previously saved version of the file fred.odt as fred.bak in the Backup folder. Do so by: Tools > Options > Load/Save > General ... The Backup folder location is shown by Tools > Options > OpenOffice > Paths ... You may need to switch on Show hidden files (Control Panel > Folder Options > View ...) to be able to see the folder and its contents. Remember, however, that highly_personal.bak will still be in the Backup folder long after you have deleted highly_personal.odt.
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] Compressing size of an odt containing large ima

Post by John_Ha »

It appears that LibreOffice has more facilities for compressing individual images in a .odt file. r-clicking any image gives the following options:
Clipboard01.png
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.
serenejean
Posts: 18
Joined: Wed Jan 22, 2014 3:41 am

Re: [Solved] Compressing size of an odt containing large ima

Post by serenejean »

[quote="John_Ha"]
Your efforts in the extensive reply are much appreciated but unfortunately I'm down at the first hurdle! I'm not able to " Unzip the .odt file with an unzip utility - it will look like this."
Neither the original file, nor the copy of the file I've made, was in a zip folder. I added a zip folder to the copy but can't achieve the result you've shown. This is how I tried to do it:
for forum.jpg
Is there another way?
If I could get past this step, I understand the following steps and will certainly try them.
I've learnt (the hard way) not to copy & paste graphics in future - I'll be using a lot more links to them!
OpenOffice 4.1.1, Windows Vista
User avatar
Greengiant224
Posts: 283
Joined: Wed Jun 09, 2010 3:50 pm
Location: All Over The World

Re: [Solved] Compressing size of an odt containing large ima

Post by Greengiant224 »

serenejean:
I think you need to click on 'Open' or try 'Open Archive'

This should display the contents of the .odt file in a dialog box.
You should then be able to follow the rest of the instructions as posted.

Does this help?

Greengiant224

Win 7, Portable AOO 4.1.14, LibreOffice 6.2, 7.4.5 & 7.6.1 (Java 1.7.81 & 1.8.0_281) utilising HSQL 1.8.10 & 2.4.*, MySQL, PostgreSQL, SQLite
+ Blood, Sweat and Tears (Application, Determination and Perseverance)
serenejean
Posts: 18
Joined: Wed Jan 22, 2014 3:41 am

Re: [Solved] Compressing size of an odt containing large ima

Post by serenejean »

Unfortunately I'm still not able to achieve the result shown in the first graphic in John_Ha's post. This is what I've now tried:
Screen clipping taken 6022016, 1057 AM.pdf
(98.36 KiB) Downloaded 255 times
OpenOffice 4.1.1, Windows Vista
Bill
Volunteer
Posts: 8934
Joined: Sat Nov 24, 2007 6:48 am

Re: [Solved] Compressing size of an odt containing large ima

Post by Bill »

The most popular archiver for Windows is probably 7-Zip (that appears to be what John_Ha is using and it's all I've used for years). After downloading and installing 7-Zip, right-click the .odt file and select 7-Zip > Open Archive. The archivers you are using may have similar ways to open odt files as an archive, but I've never used either one.
AOO 4.1.14 on Ubuntu MATE 22.04
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Compressing size of an odt containing large ima

Post by John_Ha »

1 Rename fred.odt to fred.zip
2 double click fred.zip - this will open it using Windows' built in unzipper
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] Compressing size of an odt containing large ima

Post by John_Ha »

serenejean wrote: ... unfortunately I'm down at the first hurdle!
You may find it quicker and easier to

1 Download and install LibreOffice
2 Open your file with LibreOffice
3 Resize each image to the optimal size by r-clicking each image > Compress image ...
Note how you can use lossless (graphics, PNG etc) or lossy (photos, JPG) compression. You can also select a dpi and jpg Quality Factor etc. You see the effect immediately. If the resulting compressed quality is too poor, you can undo the compression.
4 Save the .odt file.

This resizes the image file in the .odt without your needing to unzip anything.

Now carry on in OpenOffice. Be sure not to use LibreOffice to add a Textbox as Writer does not understand Textboxes.

Some useful hints on images ...
 Edit: The hints below have been expanded into a tutorial.

See [Tutorial] Some useful hints on using images for a discussion on how best to handle images in Writer.

The tutorial is continuing to be updated. 
I have just been creating a document with 15 images, each a JPG of about 500kB to 1MB, and I found Writer 4.1.1 to be very slow. I need to do some more investigation although I did raise this bug report some time ago Issue 125490 - Writer 4.1.1 very slow with large images, locks up with zoom out on 2 page view. It is even worse with a Master document calling lots of sub-documents - Writer just hanged.

You need some workarounds which are all based on minimising the image file sizes while maintaining the highest sensible quality.

First, know the difference between a photo image, which is a photo; and a graphics image, which is not a photo - it is clip art, diagrams, things with large blocks of the identical colour, drawings, logos and anything with text etc. The image below is composite - 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).

Second, you need to know how many pixels need to be in each image. Assume Image_1 will be 4 inches wide when printed. You need to check with your printer what resolution (in dpi, or dots per inch) they will be printing at. If they say they will be printing at 150 dpi (150 dpi is good quality, 300 is very good, 600 is fantastic quality) then Image_1 needs to be 4 inches x 150 dots per inch = 600 dots (pixels) wide. If you have more pixels that that (and remember a 6 mega-pixel photo is over 3,000 pixels wide!) then they will be wasted and just clog up the .odt file. So re-sample Image_1 to be 600 pixels wide (I use the free IrfanView viewer - it has a better re-sampling algorithm than Writer's re-sampling algorithm). A 600 wide pixel image file will be 25x smaller than a 3,000 wide pixel image. Use Image > Resize/Resample as in the image below where I am re-sampling a 4,320 pixel image from my camera down to 600 pixels wide which will make the file 52x smaller (600/4,320) * (600/4,320) = 51.84x smaller.

Third, always insert JPG files by Insert > Picture > From file as it saves the image as a JPG in the .odt file. Never insert photos or JPG files by copy and paste. You can insert graphics (clip art, diagrams, cartoons etc) by copy and paste as they will be JPG or GIF or TIFF.

Fourth, make sure you are using compressed file formats. JPG uses lossy compression and is excellent for photos, but useless for graphics as it blurs edges, add blotches etc. PNG, GIF and Compressed TIF (or compressed TIFF) use lossless compression and are excellent for graphics, but useless for photos as they don't compress the files size much if atb all, and may actually increase the file size compared with JPG! Never use BMP as it is not a compressed file format.

Fifth, if image size is still a problem while you are editing, then create some draft images with really small pixel counts - say just 100 pixels wide. Stretch them to be the same size as the proper pictures. The image will be recognisable, but the quality will be rubbish, but the file size 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 higher quality images. See the second image which I re-sampled down to 100 pixels wide - it is only 22kBytes but recognisable even when stretched to the original size.

Sixth, if you can get away with using 8 bit colour images instead of 24 bit colour images, then the file sizes will be 3x smaller again. Change the colour depth in IrfanView by Image > Decrease colour depth.

Seventh, 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. 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 QF100 as saving at QF85 reduces the file size enormously.

Eighth, it may also help to turn off graphics display by Tools > Options > OO Writer > View > Display > Graphics & Objects ... Set to OFF. The images are now shown on screen as empty rectangles labeled "graphic", but the images will still appear in File > Page Preview, and when you print or Export to PDF.

Ninth, The default values of the AOO Graphics Cache are rather small. PCs have much more memory these days, so it is worth while to increase them as shown in the image below. Tools > Options > OpenOffice > Memory > Graphics cache ... Set Use for AOO to 256 MB and Memory per object to 100 MB.

Tenth, and VERY important. Do not be too quick in slamming the laptop lid shut when 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). An AOO file of 80MBytes takes a LONG time to write - several (many?) seconds. I am fairly convinced that lots of 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.
Last edited by John_Ha on Tue Feb 14, 2017 1:38 am, 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.
serenejean
Posts: 18
Joined: Wed Jan 22, 2014 3:41 am

Re: [Solved] Compressing size of an odt containing large ima

Post by serenejean »

John_Ha's comprehensive reply is greatly welcomed. Thank you! There's so much for me to learn!
I'm amazed at the improvement of the second file after I saved the contents of the original into a new file ('removing the tangles'). Just doing that has made it tolerable to work with but I will be following all the other advice just to become more knowledgeable. I'm so grateful.
OpenOffice 4.1.1, Windows Vista
Post Reply