Image compression in writer

Discuss the word processor
Post Reply
simiae
Posts: 3
Joined: Wed Mar 19, 2008 4:07 pm

Image compression in writer

Post by simiae »

Hi,

im new user of OO, but until now i was able to solve all my problems. Now i need help with sth called image compression and cut or crop image. This feature is in MS Word, but i cant find it in OO Writer. Main problem is, that im working with documents full of pictures and those makes them too big for sending via email. Usualy i can export it to pdf, but sometimes i need to send it as odt or doc. I can also use msword to compress images in document but its a little bit sick :-). So my question is, is there some possibility to decreese the size of document in OO, using sth like image compression?

Many thx for answer, Tom.
Phil
Volunteer
Posts: 802
Joined: Fri Nov 30, 2007 5:35 pm
Location: Germany

Re: Image compression in writer

Post by Phil »

Hi and welcome to the community!

Unfortunately, there is no automatic compression function for images like available in MS Office. However, I don't really like it anyway, as image quality is reduced (except for the cropped part).
However, OpenOffice usually stores images very well compressed (except for some special cases, see this thread).

So it really depends on the source images. What type of images are they? Bitmap or vector graphics? Which format exactly?
The function Edit - Paste Special lets you import the images in different formats, so you could try out which one leads to the best results both in terms of image quality and file size. And cropping should be done before pasting the image.
I have documents with approx. 100 bitmap images, and the resulting file size is approx 1.5 MB.

If you convert documents that are already in .doc format, you may try to cut the images and paste them again with Paste Special.
BTW: Also MS Office allows pasting in different formats.

To crop bitmap images, you can use free tools like IrfanView.

Another thing:
There is a crop function in the Crop tab of the image properties dialog, however this preserves the image itself and thus does not lead to a reduction in file size.

Hope this helps!

KR, phil
OOo 3.0.1 & DEV-3.1 • WinXP pro 32-bit + SP3 + current patches
Looking for OpenOffice-related information? Try the search engine on OpenOfficeNinja - a great tool!
My favorite extension: Alt. Find & Replace for Writer. All you need and much more...
OOo 2.4.X on Ms Windows XP
User avatar
Bhikkhu Pesala
Posts: 1253
Joined: Mon Oct 08, 2007 1:27 am

Re: Image compression in writer

Post by Bhikkhu Pesala »

simiae wrote:Now i need help with sth called image compression and cut or crop image.
Try to avoid the word compression (text speak). Most of us helpers here are old guys who don't know this lingo. “I need help with image compression and cropping," would have been shorter.

This issue requests the feature, but I think the best solution is to compress your images using IrfanView, when you know exactly how big you need them to be. Don't resize dialogue boxes and similar screen shots. Save them as PNG and crop them if necessary. Shortcuts cut corners and degrade the images.
Idiot Compassion
LibreOffice 6.0.4 on Windows 10
simiae
Posts: 3
Joined: Wed Mar 19, 2008 4:07 pm

Re: Image compression in writer

Post by simiae »

thx for answers. I hope that once writer will have this simple feature - crop "definitely" or compress all images in document, coz it will save me a lot of time and memory as well :-). Im using styles and keyboard shortcuts as much as possible even for images and i cant focus on file size from the begining. I need it only occasionaly not in every document im working on, so it will be too dificult to use another program like irfan. Only way for me at the moment is to open the document in MSWord :roll: and compress it. (btw its realy nothing compared to many advantages of OO)
anyway thx again.
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: Image compression in writer

Post by foxcole »

You were asked to please write out your words... but I'll add that it isn't only old folks who have difficulty with "bum type". This forum is used by people globally, who do not all speak English as a first language and most of whom do not use text shortcuts. (For the record, thx means thanks, and coz means because.)

Also, OOo files are in a compressed format so image compression depends on what image format you're using. If you're using an already compressed format such as jpg or png, you won't notice a big difference in file size. The main way to cut down file size in that case is to use an external image editor and crop the images first.

Cropping is an entirely different matter. It isn't done in word processors, not in Word or Writer, I suppose because of the chance that the cropping would be done incorrectly and the full picture data may be needed, or perhaps just because these are word processors and are not designed for image handing. The "crop" actually just creates a window view of the full image, so perhaps the view might need to be adjusted as the document content changes. There may be other reasons.

There is an extension that you might want to try, however: CropOOo. Its main page says it's for Draw and Impress, but it now works in Writer too.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
simiae
Posts: 3
Joined: Wed Mar 19, 2008 4:07 pm

Re: Image compression in writer

Post by simiae »

im sorry for my english, but its not my "first" language. anyway, i dont want to be misunderstood so imagine my situation. Im working on a document. Im using about 20-30 pictures - jpgs from camera. Im using them in diferent sizes positions etc. but its simple because :-) i have set of key shortcuts ans styles. But the main core of the document is in text. Im producing about 3 of these per week. And once per month or two i need to send it as odt and not as pdf. So it would be great help to crop all images in document as it is possible in MS WORD (which i have to use in this situation). thats all
Phil
Volunteer
Posts: 802
Joined: Fri Nov 30, 2007 5:35 pm
Location: Germany

Re: Image compression in writer

Post by Phil »

So do I understand it correctly that you paste these images into the document, but you only use parts of the images, i.e. you crop a major part of the individual pictures?
Do you use the same pictures multiple times with different cropping?
Or do you just compress the images in MS Word?
What is there that would speak against cropping and/or resampling the images using an image editor before pasting them?

Another suggestion: Maybe you can upload an example here (if you agree to disclose it) so that we better understand what you are doing?
I suppose the file could be quite large, so you should use a free file hosting service like MediaFire.

KR, phil
OOo 3.0.1 & DEV-3.1 • WinXP pro 32-bit + SP3 + current patches
Looking for OpenOffice-related information? Try the search engine on OpenOfficeNinja - a great tool!
My favorite extension: Alt. Find & Replace for Writer. All you need and much more...
OOo 2.4.X on Ms Windows XP
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: Image compression in writer

Post by foxcole »

simiae wrote:So it would be great help to crop all images in document as it is possible in MS WORD (which i have to use in this situation). thats all
But you are not cropping the images in Word. Word does the same thing Writer does, that's what I was trying to explain earlier. It simply adjusts what part of the image you're able to see in the document. The complete image is still there, with all its data bloat, and you can restore it at any time with the click of a button in the edit dialog.

But do try that cropping extension I linked to. I've been using it and can recommend it.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
User avatar
Bhikkhu Pesala
Posts: 1253
Joined: Mon Oct 08, 2007 1:27 am

Re: Image compression in writer

Post by Bhikkhu Pesala »

If you're using Windows, then cropping and/or resizing your images first in IrfanView is definitely the best way to go. It really is very simple to use. Open the image in Irfan View from Windows Explorer, Select with the mouse what you want to view, Crop (Control Y), or Resize (Control R), and then save it as a new image. Place that new image in Writer.

If you want, just copy and paste the resized image via the Windows clipboard without saving it at all.

You can crop an image in Writer from the image properties dialogue (double-click any image), but that doesn't reduce the image's filesize. The whole image is still in your document.

You can resize an image in Writer simply by dragging the corner handles, but again that doesn't reduce the image's file size. With 20-30 images from a modern digital camera, your Writer document is going to be a lot bigger than it needs to be, and therefore slow to load, save, and email.
Idiot Compassion
LibreOffice 6.0.4 on Windows 10
User avatar
Cambirder
Volunteer
Posts: 647
Joined: Thu Nov 22, 2007 1:01 am

Re: Image compression in writer

Post by Cambirder »

Im working on a document. Im using about 20-30 pictures - jpgs from camera.
Resizing images in word is a really poor way of doing it, as the final image quality is poor, the best solution would be to do a batch resize in image editing software such as PhotoShop, PaintShop Pro or some of the free image programs such as Faststone Image Viewer. That would allow you to resize, compress and sharpen 20 images with one click. Having the crop facility would be useful but if you crop all the images in advance it is actually probably quicker than doing it in document.

I normally use PhotoShop. but I just tried the above with Faststone Image Viewer on five 3468 x 2192 pixel 3.5 Mb Jpegs which I reduced to 640 x 480 pixel 32Kb files still maintaining acceptable quality.
OOo 3.3 on Windows 7 & 3.2.1 on Mint 10
Phil
Volunteer
Posts: 802
Joined: Fri Nov 30, 2007 5:35 pm
Location: Germany

Re: Image compression in writer

Post by Phil »

foxcole wrote:Word does the same thing Writer does, that's what I was trying to explain earlier. It simply adjusts what part of the image you're able to see in the document. The complete image is still there, with all its data bloat, and you can restore it at any time with the click of a button in the edit dialog.
There is a function in newer MS Office versions (2003?) that indeed delete all the image parts that were cropped. This may be what simiae is referring to.

KR, phil
OOo 3.0.1 & DEV-3.1 • WinXP pro 32-bit + SP3 + current patches
Looking for OpenOffice-related information? Try the search engine on OpenOfficeNinja - a great tool!
My favorite extension: Alt. Find & Replace for Writer. All you need and much more...
OOo 2.4.X on Ms Windows XP
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: Image compression in writer

Post by foxcole »

Phil wrote:There is a function in newer MS Office versions (2003?) that indeed delete all the image parts that were cropped. This may be what simiae is referring to.
I guess it's been quite a while since I've tried cropping any images in Word. However, trying it in Word 2003, I see that the "compress picture" dialog contains an option "Delete cropped areas of pictures".

For my test in Word, I created three new documents and inserted the same 104KB jpg image into each. The first was my control file, saved without performing any action on the image, and its file size was 136KB. In the second, I cropped the image and applied compression without the delete-crop option, and with no change to the image resolution (so, no compression of the image data and no deleting of cropped bits). Its file size was also 136KB, so no deletion has occurred by cropping alone. The entire image is still there. In the third test I cropped then applied compression with the delete-crop option, again with no change to resolution, and the result was 48KB.

I then applied compression in the control file to reduce the image resolution for print (as opposed to the other options, Web/Screen or No Change). The file size remained 136KB, which means no data loss occurred with compression---the image was not reduced.

This could mean one of two things, either the file still contains the entire image data (which I doubt because otherwise the compression option would be pointless) or because the jpg is already a compressed format no compression occurred, as it was already at or below the 200 dpi resolution hard-coded for the Print option.

The Web/Screen option is hard-coded for 96 dpi (which makes no sense because displays are in pixels, not dpi). Choosing it reduced the file size to 88KB but the image quality is, of course, visibly affected.

Now, testing the CropOOo extension in Writer 2.4, I inserted that same 104KB image in two new documents. The first is, again, a control document with no change to the image. In the second, I cropped using the CropOOo extension, and in the third, I cropped using the native crop tool. Opening each file with 7-zip and examining the image size, they were all 103KB. (The 1KB difference from the original could be either a difference in rounding the actual file size, or a result of the image being compressed slightly in the .odt archive format. I'm not sure which and, at the moment, don't have the desire to go figure it out.)

So the CropOOo tool doesn't remove image data either, it just makes "cropping" more visual and direct.

I will stand by the recommendation, then, to use an external tool for cropping and reducing file size, and I would recommend it for Word as well. Word's built-in tools are not worth bothering with.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
huw
Volunteer
Posts: 417
Joined: Wed Nov 21, 2007 1:57 pm

Re: Image compression in writer

Post by huw »

foxcole wrote:Word's built-in tools are not worth bothering with.
I have to disagree - the option to compress images when doing a "save as..." is very useful, as simiae has found.

JPEGs from a camera are going to be in the 2 - 5MB range. Granted they could be reduced, but even then it wouldn't take many at print-quality to make the doc too big for email.

Here is the MS article about it all - the feature used by simiae is the very last tip at the end: Reduce the file size of a picture
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: Image compression in writer

Post by foxcole »

huw wrote:
foxcole wrote:Word's built-in tools are not worth bothering with.
I have to disagree - the option to compress images when doing a "save as..." is very useful, as simiae has found.

JPEGs from a camera are going to be in the 2 - 5MB range. Granted they could be reduced, but even then it wouldn't take many at print-quality to make the doc too big for email.
I know about that article. I use Word's help files.

I based my opinion on:
1) the lack of cropped-data removal unless compression is used,
2) the lack of compression at 200 dpi,
3) the lack of image quality at 96 dpi, and
4) the inability to control the image resolution (compression amount, data removal amount).

Using an external software like Irfanview to capture the images from the camera, batch compress and crop the images before pasting them into a document really does not take more time and results in much better quality and smaller image files. Word processors are the wrong tool for that job.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
turing79it
Posts: 2
Joined: Wed Apr 16, 2008 11:28 pm

Re: Image compression in writer

Post by turing79it »

Using an external software like Irfanview to capture the images from the camera, batch compress and crop the images before pasting them into a document really does not take more time and results in much better quality and smaller image files. Word processors are the wrong tool for that job.
I do not concur.
In my case for instance, I'm writing a document with several reproductions of a scanned handwritten document.
Sometimes I need to reproduce entire words. Sometimes entire lines. Sometimes just a letter, or just a small piece of a letter.
And there are hundreds of such images.

I can't possibly resample the dpi of each and every of them outside the word processor. It would take ages.

It is MUCH more efficient to have only one scan at the highest resolution needed, then copy and paste the required area, resize it in place, and then have the word processor resample the images according to 1) target dpi; 2) target size.
It saved me hours of time and megs of space.

So, the question stands: anybody knows of a tool to resample all images in a writer document, so that their dpi is a chosen number - as can be done in Word?

M.
Phil
Volunteer
Posts: 802
Joined: Fri Nov 30, 2007 5:35 pm
Location: Germany

Re: Image compression in writer

Post by Phil »

Hi turing79it and welcome to the community!
turing79it wrote:It is MUCH more efficient to have only one scan at the highest resolution needed, then copy and paste the required area, resize it in place, and then have the word processor resample the images according to 1) target dpi; 2) target size.
I completely agree with you.
Although the functionality in MS Word leaves a lot to be desired, it is worth having that in a word processor.
turing79it wrote:So, the question stands: anybody knows of a tool to resample all images in a writer document, so that their dpi is a chosen number - as can be done in Word?
AFAIK such a tool does not exist. Also, it should rather be an enhancement in Writer.
There are three issues covering the main aspects: #15378, #15379 and #71009.
As especially #15378 and #15379 already have quite a lot of votes, there is a slight chance that this will be addressed quite soon - although no target milestones are defined yet. :(

KR, phil
OOo 3.0.1 & DEV-3.1 • WinXP pro 32-bit + SP3 + current patches
Looking for OpenOffice-related information? Try the search engine on OpenOfficeNinja - a great tool!
My favorite extension: Alt. Find & Replace for Writer. All you need and much more...
OOo 2.4.X on Ms Windows XP
turing79it
Posts: 2
Joined: Wed Apr 16, 2008 11:28 pm

Re: Image compression in writer

Post by turing79it »

Phil wrote:AFAIK such a tool does not exist. Also, it should rather be an enhancement in Writer.
There are three issues covering the main aspects: #15378, #15379 and #71009.
As especially #15378 and #15379 already have quite a lot of votes, there is a slight chance that this will be addressed quite soon - although no target milestones are defined yet. :(
Hi!

I'm trying to write a small external tool that unzips the od? file, looks for all the images in content.xml, gets their size and resamples them with imagemagick, recreating the original file.

We'll see if I get anywhere :)

M.
Phil
Volunteer
Posts: 802
Joined: Fri Nov 30, 2007 5:35 pm
Location: Germany

Re: Image compression in writer

Post by Phil »

turing79it wrote:I'm trying to write a small external tool that unzips the od? file, looks for all the images in content.xml, gets their size and resamples them with imagemagick, recreating the original file.
I admit that's really a cool idea! 8-)
I think such a tool would be greatly appreciated by the community. So if you have it working, you could post it under a new "[hint]" thread.

Anyway, good luck! :)
phil
OOo 3.0.1 & DEV-3.1 • WinXP pro 32-bit + SP3 + current patches
Looking for OpenOffice-related information? Try the search engine on OpenOfficeNinja - a great tool!
My favorite extension: Alt. Find & Replace for Writer. All you need and much more...
OOo 2.4.X on Ms Windows XP
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Image compression in writer

Post by acknak »

Have you looked at the Sun Presentation Minimizer? http://extensions.services.openoffice.o ... nMinimizer

It would be nice if there was one tool that could work on any kind of ODF document
AOO4/LO5 • Linux • Fedora 23
User avatar
RoryOF
Moderator
Posts: 34610
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Image compression in writer

Post by RoryOF »

If I remember correctly the source for the Presentation minimizer is available; this would make a useful starting point for the code for a Writer minimiser.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Post Reply