[Solved] Managing Photos pasted in Calc

Discuss the spreadsheet application
Post Reply
arvin555
Posts: 4
Joined: Wed Jun 18, 2014 12:39 pm

[Solved] Managing Photos pasted in Calc

Post by arvin555 »

I would like to ask for help from you guys with regards to my concern.

Usually I would use a spreadsheet (Excel) to send photos with labels, it's just easier to share this way.
What I usually do is use a photo editor then cut and paste the photo onto the spreadsheet (Excel).
I will usually use "Paste Special" then choose Picture (enhanced Metafile)
Then I will resize accordingly.
Then to save file size, I would cut the whole picture and "Paste special" using Jpeg this time (for compression).
So not only was I able to resize to the document, when I cut and repasted using Jpeg, the file size of the spreadsheet has gone down a lot.

Now we have a few computers using Ubuntu and OpenOffice, and unfortunately I have not been able to figure out the best way to do the same thing. I would like to ask your suggestions:

1. When I paste for the first time on Calc the option is "Paste Special" and the options are usually either only bitmap or with others like GDI Metafile, SVXB and Adobe Photoshop image.
Question: What is the best choice at this point, so that I can adjust the size without any losses, etc.

2. Then when I cut the same imagine in Calc, I get the same options as above, usually without Adobe Photoshop Image anymore, though Star Object descriptor becomes a new option. At this point I have been able to resize it to the size I want it to be on the spreadsheet, so the next objective is to make it so that the spreadsheet file size is small (for emailing and stuff).

Question: Which option should I use to Past special the resized photo so that the overall file size is small? Just like what usually do with Excel and Jpeg? Drawing format, Bitmap, GDI Metafile, SVXB?

I assume that for file size bitmap will be the worse choice right?

Thanks in advance for any suggestions you can give.

Arvin
Last edited by Hagar Delest on Fri Jun 20, 2014 11:35 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 3.3.0
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Managing Photos pasted in Calc

Post by Villeroy »

Calc is an arithmetic calculator. You can not manage any photos in an arithmetic calculator
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
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Managing Photos pasted in Calc

Post by acknak »

I have to agree with Villeroy: Calc is not a good choice for this. However, you can certainly do it this way if it's what you like.

As far as paste formats: you can entirely forget about it. Just paste the image. OO compresses the image data by default. It may not be the absolute best compression, but it's close enough that there's no sense in worrying about it, especially if you want lossless compression.

I would also suggest to make sure that any image in Calc is anchored to the page, not to a cell: right-click > Anchor > To Page

Otherwise, changing a column/row size may also change the image dimensions and aspect.
AOO4/LO5 • Linux • Fedora 23
User avatar
MTP
Volunteer
Posts: 1620
Joined: Mon Sep 10, 2012 7:31 pm
Location: Midwest USA

Re: Managing Photos pasted in Calc

Post by MTP »

I'd suggest not pasting into Calc. Instead, paste into a very basic "MS Paint-type" editing software. Then resize as desired and save as a .jpg. Then insert the saved file into Calc (Insert->Picture->From File). Some software options for Ubuntu are listed at 8 Great Paint Programs for Linux and Top 10 Painting Programs for Ubuntu.
OpenOffice 4.1.1 on Windows 10, HSQLDB 1.8 split database
arvin555
Posts: 4
Joined: Wed Jun 18, 2014 12:39 pm

Re: Managing Photos pasted in Calc

Post by arvin555 »

Thanks for your replies guys. Unfortunately would still appreciate replies to my questions about which format is best to use in Paste special.

Calc as I understand is a spreadsheet program Math is the calculator program, which actually is confusing :)

The reason why I do what I do with Excel is that it is so much easier to resize (dimension) while on the spreadsheet already, so that I can change the size based on the form or layout that I want to send. It is usually a report which is in xls form.

I have read about the compression capability of OO, but unfortunately the file size still ends up quite big, not fit for emailing.

Thanks for the tip about anchoring, will do so!

But would still really appreciate input on which type to choose when pasting. Please!

Best regards!
Arvin
OpenOffice 3.3.0
User avatar
keme
Volunteer
Posts: 3699
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Managing Photos pasted in Calc

Post by keme »

arvin555 wrote:... Calc as I understand is a spreadsheet program Math is the calculator program, which actually is confusing :) ...
Not quite. Calc is a spreadsheet program. Math is a formula editor (akin to the equation editor in Microsoft Office). IOW, Math doesn't do mathemathics, it just allows for a visual representation of mathemathical concepts. Confusing? Sure!
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Managing Photos pasted in Calc

Post by RoryOF »

You might consider pasting them into Impress OpenOffice's Presentation application: you can change page layout in Impress (/Format /Page) to any format you wish, and add comments under the photo. You can then run Presentation Minimiser to reduce file size to suit a target device.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Managing Photos pasted in Calc

Post by acknak »

arvin555 wrote:... I have read about the compression capability of OO, but unfortunately the file size still ends up quite big, not fit for emailing. ...
The only parameter that significantly affects the file size is how many pixels you have in the image. The file size goes up by the square of the change in image size: if you paste in an image half as large, it will take one-quarter the size in the file.

If you want a smaller file, paste in smaller images--resizing the image after you paste it into Calc does not change the number of pixels stored in the document.

If you need to distribute large files, put them up on some file-sharing site or cloud storage site and email a download link.
AOO4/LO5 • Linux • Fedora 23
arvin555
Posts: 4
Joined: Wed Jun 18, 2014 12:39 pm

Re: Managing Photos pasted in Calc

Post by arvin555 »

Thanks for being patient with me guys.

I am currently on an Ubuntu computer and using OpenOffice 3.2 but I imagine my test results might be the same in all of the versions.

I went ahead and did some testing really hoping to be able to figure out this thing with Open Office (hard headed as I am) :crazy:

1. I used gimp shop to open a photo, then copied it ("clipboard)".
2. Opened Calc 3.2 and pasted it using Paste Special. Then I chose each of the options:
a. Paste special Bitmap then saved as Bitmap.xls
b. Paste special Gdi metafile then saved as metafile.xls
c. Paste Special SVXB then saved as SVXB.xls
d. If I cut the same photo and then did Paste Special there is a new option "Drawing" so pasted as Drawing and saved as Drawing.xls

When I checked the file sizes of all 4 test files, they were quite identical, the only one that was a bit smaller was Bitmap (to my surprise), the difference in my test is 200kb but it might differ of course.

Even if I resized it and pasted it as the same format, the file size didn't change.


3. Then I started experimenting with cutting the same photo, resizing the photo and then pasting it using a different option.
a. Pasted as GDI Metafile then resized it, then cut it and then pasted as Bitmap named it Metabmp.xls
b. Pasted as Bitmap, then resized it, then cut it and pasted as Bitmap named it bmpbmp.xls
c. Pasted as SVXB, then resized it, then cut it and pasted as Bitmap named it SVXB.xls

The result was that all were the same file size as before, except the Metafile then resized then pasted a Bitmap. :bravo:

So this solves my problem/question. In order to get a smaller file size, for the complicated way I do it with excel. We can do it with OpenOffice.

First paste the Picture as a GDI Meta then you resize it (Don't forget to hold Shift so the ratio is retained) when the photo is the right size already, cut it and then paste (special) as Bitmap. The file size will be significantly smaller than other options.

I tried to resize the Meta then Bitmap thing, and the expanded photo was very pixillated, showing that there is huge compression (which was mentioned by acknak (thanks), which is what I was after. :super:

This works on Word processor (writer) as well. Might work for Impress as well, will try this out now that I know the sequence.

Now I wonder if anyone can explain why this happens? :knock:

Thanks again everyone!
Best regards!
Arvin
OpenOffice 3.3.0
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Managing Photos pasted in Calc

Post by acknak »

arvin555 wrote:...
The result was that all were the same file size as before, except the Metafile then resized then pasted a Bitmap. :bravo:
...
Now I wonder if anyone can explain why this happens? ...
Resizing an image in OO does not change the number of pixels, it only changes the size that the image is rendered on the screen or on paper.

The size changes on conversion from metafile to bitmap because the metafile is a vector format. In order to convert to a bitmap, the metafile has to be rendered (at the smaller size), this requires resampling the image data: the converted/pasted bitmap result has fewer pixels.

I guess I should qualify what I said above: paying attention to the image format MAY help with the file size; it depends on what's in the images. For screenshots or simple graphics, a jpeg image will generally be about the same size (or even larger) than OO's default PNG image format. For photographs, the jpeg compression does much better than PNG.

The only way I know of to get jpeg image data embedded in the file is to use Insert > Picture > From file and choose a jpeg image file. Copy/Cut/Paste will always embed in a PNG bitmap (or similar) in the file, not a jpeg.
AOO4/LO5 • Linux • Fedora 23
User avatar
karolus
Volunteer
Posts: 1158
Joined: Sat Jul 02, 2011 9:47 am

Re: Managing Photos pasted in Calc

Post by karolus »

Hallo

All you need should be doable by some commandline with imagemagick

Karolus
AOO4, Libreoffice 6.1 on Rasbian OS (on ARM)
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
arvin555
Posts: 4
Joined: Wed Jun 18, 2014 12:39 pm

Re: Managing Photos pasted in Calc

Post by arvin555 »

The size changes on conversion from metafile to bitmap because the metafile is a vector format. In order to convert to a bitmap, the metafile has to be rendered (at the smaller size), this requires resampling the image data: the converted/pasted bitmap result has fewer pixels.
Thanks, this makes sense and answers the question, why it becomes smaller.

As for jpeg pasting using paste from file, I will try to experiment of doing so will make the file size of the spreadsheet smaller, or pasting a big jpeg then resizing, cutting then pasting as bitmap as I explained above, will get the same result as the metafile. Thing is I'm in the habit of cutting from the photo editor (Gimp for example) and pasting directly, so as you said I am basically pasting using the default png/bitmap.

Thanks again!

Karolus, Thanks for the info about imagemagick, checked out the link, the problem is it's script, will need to teach officemates the same system of pasting, resizing and then pasting again, I am almost sure they won't be able to handle script commands :) Plus it's the same thing with resizing from other photo editors, I won't know if the photo is the correct size to the document I am pasting on.

Basically problem solved already! by pasting as metafile then cut them bitmap. Thanks everyone!
OpenOffice 3.3.0
Post Reply