# exporting to max. 5MB



## Harry Briels (May 6, 2012)

How can I export in LR3.6 my Leica M9 images (18,5MB) to max. 5MB?
I put in: Jpeg, sRGB , "Quality" to 100 and resolution 240 pxi
a) If I check the box "resize to fit" and check the box "don't enlarge" the MB-sizes at export are unchanged;
b) If I leave "resize to fit" unchecked MB-sizes remain unchanged;
c) If I check "resize to fit and leave "don't enlarge" unchecked, some cropped images get even a larger size!; 

I just want to export all images in a size of maximum 5 MB, so smaller sizes than 5MB (all cropped images)  should be exported unchanged, whereas all other images originally in 18.5MB should not be larger than 5MB when exported.

What mistake am I making?
Thanks for help!


----------



## Jim Wilde (May 6, 2012)

Have you tried using the option to "Limit File Size"?


----------



## erro (May 6, 2012)

Do you get 18,5 MB JPG files as original? Or are those raw files?

Exporting as a 5 MB JPG is still a pretty big JPG.


----------



## Harry Briels (May 6, 2012)

Jim Wilde: no I have not used "Limit file size"

Robert:
I want to export DNG's incl. their individual LR adjustments, for putting together a photo album.
The max image size allowed in this album is 5MB (Jpeg in sRGB)
The DNG files are 18.1 MP

In the exporting dialog I use the following:
-File settings: Jpeg, sRGB, quality 100
- Image sizing: I checked "Resize to fit"; Megapixels; I checked "Don't enlarge":
                        I selected 5 Megapixels; 240 resolution.
What I want to accomplish is that no exported image is larger than 5 MP, and that all image that are cropped and are smaller than 5MB remain unchanged.

However strange things happen:
When I export an image of original dimensions:  5212 x 3468  18.1 MP, and cropped size 4877 x 3238, and when using the above configuration, this exported image is still "6.8 MB on disk!
I can not understand that it can be larger than the inserted 5 Megapixels?


----------



## Jim Wilde (May 6, 2012)

You keep switching in your posts between Mega*Pixels* and Mega*Bytes*.....these are NOT the same thing! Sort out what exactly you need to do, then we can tell you the right way to do it....


----------



## Harry Briels (May 6, 2012)

Jim,
I realize that megapixels and megabytes are not the same thing.
This is a rather complicated matter for simple photo amateurs like myself and I am certainly not the only one having problems with MP and MB.
This is also the reason for asking for help.
In my above explanation I can't see where, as you saying, I do mix up MP and MB? Yes, I do in the opening questions. Sorry for that!

If you want to help me than please tell me what to do in the export dialog to accomplish my goal: "to limit the images to maximum 5.0MB".
Thank you on beforehand!
Harry


----------



## Jim Wilde (May 6, 2012)

I'll be be pleased to help, but you weren't very clear. I asked you if you had tried to use the "Limit File Size" option, which is the correct tool if you want to set a specific maximum file size in MB. You said you hadn't and then started talking about megapixels, hence MY confusion and request for clarification.

So, now that you have confirmed your requirement, I suggest you try the "Limit File Size" option and set the value to 5000K. Let us know if that works out.

Note that the Quality setting is disabled when you use that option, as Lightroom will control that element to manage the file size down to the requested amount. However, you can still use 'resize' if you wish.


----------



## Harry Briels (May 6, 2012)

I followed your advise and applied only "Limit File size to 5000k" and indeed the jpeg's that result are reduced in size within the goal of the 5MB range.
You also said "I can still use 'resize' if I wish". 
I assume that I should understand this as use either the "limited file size" or the "resize"?

As a try out I exported an image 5212 x 3468 - 18.1 Mp and applied the following:
a) "limit file size to 5000k". 
The result was: 5212 x 3465 and 4.4MB on disk;

b) I checked "resize to fit" and I checked "don't enlarge" too, quality 100, 5.0 Megapixels,  resolution 240.
The result was 2741 x 1824 and 7.9 MB on disk; Here the (for me) strange matter is that the file size is 7.9MB on disk.

c) "limit file size to 5000k" and the settings of "b)" Most likely one should not apply this combination?
The result was 2741 x 1824 and 4.7MB on disk.

For me as an amateur, it is kind of strange that a) generates a large dimension but the lowest 4.4MB, whereas the combination of a) and b) in the third try-out generates a dimension which is approx. half of the one in a).
Is this because option "c" applies reduction twice?

I hope I didn't undermine your patience too much  with my questions!
I thank you for helping me out!
Harry


----------



## erro (May 6, 2012)

As said: megapixels and megabyte are not the same thing.

Megapixels is just the number of pixels in a photo, counted by millions
Megabyte is the file size on disk, measured in millions of bytes.

If your original photo is 5212 x 3468 pixels then it is 5212*3468/1000000=18,07 megapixels

If you want to export that as a JPG-file with maximum 5 MB (megabyte) file-size you have two options to play with:
- pixel dimensions
- compression level

With "resize" you can adjust the pixel dimensions, that is: resize the photo (decrease or increase the number of pixels). This will affect the number of pixels stored in an exported file. Which, in turn, affects the file size.
With "quality" you can adjust the level of compression that is applied to a JPG. This will affect the file size (and quality) of an exported JPG.

You can use either of the two options, or both, depending on what you want to do.

If you want to print the photos you probably want them to have as many pixels as possible, thus your option a) is the best. You retain all your original pixels and you get a resultant JPG of less than 5 megabytes (MB).

If you want to display the photos on the web you probably want to resize them to a normal viewing size (perhaps something like 1000 pixels along the longest side) so that people can view them on a normal screen. Then you choose "resize to fit" and enter the desired pixel dimensions. This alone will probably get you files of less than 5 megabyte, since a JPG of 1000*something pixels wont be very large in file size.

Resizing to a specific number of megapixels is an option that I don't really know what it is usefull for.


----------



## Harry Briels (May 6, 2012)

Robert,
Thank you for this clear explanation!
I assume that in 'limit file size' 5000k stands for 5MB?
In other words if I want to limit to e.g. 3.5 MB I will insert 3500?
Thanks again,
harry


----------



## erro (May 6, 2012)

Exactly. Standard computer abbreviations.

3,5 megabytes (MB) = 3500 kilobytes (kB) = 3500000 bytes

mega is abbreviated with a large M. A small m is "mili", meaning "one thousandth", which is very different from mega.

kilo is abbreviated with a small k. A large K is used for Kelvin (measuring degrees).


----------



## Jim Wilde (May 6, 2012)

Harry,

When you export and need to ensure that the resulting file does not exceed a certain size (in bytes), there are a couple of ways that you can use Lightroom to control the output size. 

The first one, as you have now discovered, is to set the size limit in kilobytes. When you do this, the quality slider is disabled as this becomes the prime method for Lightroom to meet that size limit....and it does this by applying jpeg compression (which is what the quality slider ultimately does). The more compression applied, the smaller the output file can be, but of course the poorer the quality of the output file becomes. Some while ago Jeffrey Friedl produced a very interesting blog post about Lightrooms export jpeg quality, it's well worth a read and you can see it here. Note particularly the relationship between output file size and the quality slider.

In most cases quality 75 may well be good enough....and it would be useful if you experimented with a couple of your files and export without any resizing at say 75 and 80 (as well as 100) to see what effect that has on the file size (and if you can see any difference in image quality).

The other control is reducing the pixel dimensions of the output file....though here the effect is less certain as you cannot easily link "resizing to a pixel value" to a definitive file size on disk. 5 megapixels is not the same as 5 megabytes....in fact if I make the quality slider low enough I can maintain the full pixel dimensions of my original images  (21mp) yet have the exported file be less than 1mb on disk. Personally I don't like using this method as a 'size control' (though it may sometimes be necessary).....I prefer to resize as needed to a specific pixel dimension for a specific purpose (i.e. 1920 long edge for screen wallpaper, or 1024 long edge for digital frames).

So looking at your three points:

a) Expected result, because that's what you told LR to do....but you don't know what the resulting quality level would be. I would bet though that it would be at least 75, therefore plenty good enough. Do some tests though, to satisfy yourself.

b) Again as expected....your 'limit' was 5mp, which is not an explicit file size governor, and with 100% quality it's no surprise you ended up with >5mb.

c) Probably not needed to use BOTH limiters....I tend to use the quality slider in tandem with a specific pixel dimension if I need to worry about output file size (e.g. for emailing), though I rarely use the "Limit File Size" or "Resize to a specific megapixel size'.

Hope that helps. Have a read of Jeffrey's article.....


----------



## Harry Briels (May 6, 2012)

Jim, Robert,
Your explanation is very revealing and clear.
I will certainly read (better study) Jeffrey's article which is not going to be easy!

I understood that one can also reduce output file size just by reducing the quality slider from 100 down in the export dialog.
I tested this and reduced a jpeg of 5212 x 3468 and 18.1 Mp
by putting the quality slider to *75* which produced an output of 5212 x 3468 and 7,9 Mb;
and did the same at *60* which delivered an output of again 5212 x 3468 but only 4.6 Mb.

I wonder what _quality wise_ is the best choice when exporting?
a) limiting the file size to 5000k which generates 2741 x 1824 and 4.7 Mb, or
b) just putting the quality slider to 60?

Harry


----------



## erro (May 6, 2012)

You're getting it wrong again.

In a) you're doing two things:
- resizing to 2741 x 1824
- limiting to 5000 kB (though it seems you actually limit to 5 megapixels, given the pixel dimensions)

You have to think about how and where you want to use your JPG's. Print or web? That requires two different approaches.

Print requires many more pixels than web. For print you want to maintain your original pixels (thus: no resizing). If you then have a requirement on maximum file size you achieve that by adjusting quality (or limiting file size to the required number of kilobytes).

Web requires a resize to an appropriate viewing size. You achieve that by "resizing to fit" the desired pixels on long and/or short sides of the photo. After that you probably don't need to adjust anything further, at least not if you want the file to be less than 5 megabyte, since it will be less than 5 megabyte anyway. You may want to adjust the quality setting anyway since 100% is unneccessarily high quality, giving you an unneccessarilt large file. You can probably drop it to 75% without any visual degradation. But you have to try for yourself.

Are you understanding the difference between printing and displaying on web? They require differnet JPG's since they are different output formats.


----------



## Harry Briels (May 6, 2012)

Robert,
I certainly do understand the difference between sizing for print or for web.
I understand that for printing images in a foto album, where the maximum image size is limited by the printing company to 5.0 Mb, I should only use of the quality slider to limit the maximum file size to 5.0 Mb and stay away from "resizing to fit".

However I still would appreciate to learn what I asked earlier:

I wonder what _quality wise_ is the best choice when exporting?
a) limiting the file size to 5000k which generates 2741 x 1824 at 4.7 Mb, or
b) just putting the quality slider to 60, which results in my test 5212 x 3468 at 4.6 Mb.

If I may try to answer my own question: I feel that having 5212 x 3468 and 4.6 Mb is the better quality for printing.

Harry


----------



## erro (May 6, 2012)

To achieve the 5 MB limit you can either:
- use the quality slider yourself and adjust it to get below 5 MB (this may require some expeimenting though to see where the 5 MB limit is)
or
- use the "Limit file size to" and enter 5000 KB which will let LR adjust the quality autoimatically to get you within the limit

As for a) and b), well, you are producing to very different images. One with few pixels (2741 x 1824) and one with many pixels (5212 x 3468). They will let you produce prints of two different sizes. The more pixels, the larger prints you can make. What is your intended size?

2741 x 1824 will give you 9*6 inch prints of high quality (300 PPI)
5212 x 3468 will give you 17*12 inch prints of high quality (300 PPI)

Since both have the same file size (4,6 MB) it should mean that the 2741 x 1824 image have less compression, but allows you smaller prints. Which has the best quality will have to be visually determined. What do you want?


----------



## Harry Briels (May 7, 2012)

Robert,
The images will be placed in a photo album max. page size 40 x 30 cm (15.6 x 11.7")
All images will be smaller.
I tested both sizes on a full page and the 2741 x 1824 gives an excellent reproduction.
So I tend to conclude that using the "Limit file size" 5000k" procedure would be a good choice.

I would like to read more about this subject of pixels, Mp, Mb, PPI,  etc. to become eventually more knowledgeable. 
(at my age of 78 this hasn't become too easy!)

The book by Scott Kelby "Lightroom 3 for digital photographers", (which I use)  does not at all go deep into this subject.
I didn't really find good information on internet either regarding exporting and resizing images in LR. 
The article by Jeffrey Friedl which Jim Wilde recommended to read, is for me still far too technical and complicated.
So I am looking for more basic information in this field that eventually will make it possible for me to understand the content of articles like the one by Jeffrey.
Thank you again for your help!
Harry


----------



## erro (May 7, 2012)

I don't know if you understand swedish, but I have written an "article" on my homepage:

http://erro.se/artiklar/Bildstorlek/

If swedish doesn't work for you, you might try Googles translation:

http://translate.google.com

Just enter my link into Googles translate box and watch the magic of machine translation....


----------



## Harry Briels (May 8, 2012)

Robert,
I do not understand Swedish.
I will try to translate your article, as you suggested, as soon I have some time left for that.
I am kind of busy right now.
Thank you.
Harry


----------

