Jump to content

Changing the size of a Posted Picture


jimradja

Recommended Posts

I went to post a picture this morning and noticed it was taking a while to upload. I checked the size of the file and noticed it was about twice the size that is suggested for this site.

 

I can't figure out, however, how to downsize the file and thought someone here could clue me in. I'm working in a PC windows environment if that's relevant.

 

Thanks

Link to comment
Share on other sites

Most software for editing images allows you both to resize it in terms of the number of pixels, and to specify the JPEG compression quality, which changes the file size for a given number of pixels. Normally changing the number of pixels (resizing the image) is separate and the compression setting is part of the process of saving the file as a JPEG. Unfortunately the one bit of software I'm confident of you already having, Microsoft Paint, doesn't appear to give you any options.

 

If you use Photoshop, as Ludmilla suggests, you can certainly control options under the save dialogue. I use Photoshop on my mac, but GIMP (which is free) on Linux; it's also available on Windows (for free - www.gimp.org). There are many other tools, some of which are free; if you want to script it to resize lots of images automatically, you could also consider Imagemagick. I'm sure others can suggest their favourite options, free or otherwise - but this functionality should be in all of them. (This functionality frankly should have been in Paint, and would have been much more useful than the 3D stuff.)

 

Alternatively, if you don't want to install anything, there are online tools that will take an image and resize/recompress it.

 

If there's a piece of software you already use for image editing, please let us know and we might be able to advise where you can find the settings.

 

Hope that helps!

Link to comment
Share on other sites

You have Windows - do you have Windows Live Photo Gallery? If so, all you need to do is open that, find the image, right click on it, select resize, medium, resize and save, and you are good to go.

 

Thanks guys/gal for all the help. I use DPP (cheap Canon shooter here) and will need to check that to see if I can change the size.

 

In the short run, I tried Sandy's idea, however, and reduced the size of the picture below from over 9MB to less than 300k. Thanks.

 

342044911_20190825PaxWLRCraneinFlight-1v2.thumb.JPG.ff9d82d7251a42e32b14b1e5c8943fe7.JPG

  • Like 5
Link to comment
Share on other sites

I'm curious to know if you do any PP at all on the images (not familiar with DPP - is it Canon-specific ?), and if so, does the software enable you to resize images ? Every one I have used, from the shareware version of Paint Shop Pro on DOS (heady days - a cup of tea in between each image !) to FastStone, which I now use, has a facility for re-sizing and re-sampling to alter the output size.
Link to comment
Share on other sites

You don't need PhotoShop, nor anything else expensive and fancy. The free Irfanview image viewer/editor can resize almost any image format yet invented.

 

If you do need a more full-blown image editor, the already mentioned free Gimp open-source image editor can handle almost any kind of image manipulation you're likely to need.

You have Windows - do you have Windows Live Photo Gallery? If so, all you need to do is open that, find the image, right click on it, select resize, medium, resize and save, and you are good to go.

Whoaa! Won't that overwrite the original file with a smaller version?

 

It might be safer to use 'Save As' and change the filename slightly.

 

Having had trouble with Windows ill-thought-out Image Viewer in the past (saving a rotated version over the original without asking): I'd think twice about letting MS software go anywhere near my images.

Edited by rodeo_joe|1
Link to comment
Share on other sites

You don't need PhotoShop, nor anything else expensive and fancy. The free Irfanview image viewer/editor can resize almost any image format yet invented.

 

If you do need a more full-blown image editor, the already mentioned free Gimp open-source image editor can handle almost any kind of image manipulation you're likely to need.

 

Whoaa! Won't that overwrite the original file with a smaller version?

 

It might be safer to use 'Save As' and change the filename slightly.

 

Having had trouble with Windows ill-thought-out Image Viewer in the past (saving a rotated version over the original without asking): I'd think twice about letting MS software go anywhere near my images.

 

Nope - there is a Restore Original button - if worried or cautious, copy / paste, downsize the copy.

Link to comment
Share on other sites

Thanks for the comments on the pic. It was one of many on a pretty active day at the refuge near by. This one was one of a couple that was worth playing with.

 

I did a "Save As" to the processed file prior to playing. What you're looking at has "v2" appended to the file name. I did go back and check and didn't see a "Restore" option so maybe I'm not using the exact same program as Sandy mentioned but something similar. It certainly worked.

 

For Tony's question about processing...… DPP is short for Digital Photo Professional, Canon's free processing system. It's okay but not as powerful as the paid systems and I'm losing my reluctance to paying for one but that's a subject for another thread. I shoot RAW so everything gets something including cropping,

  • Like 1
Link to comment
Share on other sites

Got you, Jim. As far as I can see (p.81) the "convert and save" dialogue (Ctrl+D) lets you tick "resize" to scale the image (and type in some numbers), and has a quality slider for JPEG. I hope that works for you? DPP seems to list image resizing as a major feature, but they certainly don't seem to make it very clear in the documentation.
  • Like 1
Link to comment
Share on other sites

It's okay but not as powerful as the paid systems and I'm losing my reluctance to paying for one but that's a subject for another thread. I shoot RAW so everything gets something including cropping,

Did you not notice the many recommendations for the free GIMP editor?

It's almost as powerful as PhotoShop, and much better than most of the cheaper paid-for image editors.

 

There's a RAW plugin available for it (UF RAW), but I believe DDP wil convert Canon CRWs, or whatever they're called these days, to the universal DNG format.

Link to comment
Share on other sites

I went to post a picture this morning and noticed it was taking a while to upload. I checked the size of the file and noticed it was about twice the size that is suggested for this site.

 

I can't figure out, however, how to downsize the file and thought someone here could clue me in. I'm working in a PC windows environment if that's relevant.

 

Thanks

 

Not so many years ago, there was a strict size (pixel) limit for posts. I used Preview on OS X to reduce them.

 

But since the photo.net change not so many years ago, the limit is 1GB. If you have files twice that size, you

have some amazing camera!

 

I suppose if I was uploading through a 4G connection, I might go through the work to reduce it, otherwise

I expect the photo.net server to do what needs to be done.

 

By the way, FB has normal resolution mode, where it downsamples to something like screen resolution,

and high quality mode, where it keeps much more resolution, though not usually what one might call

high resolution. As above, I always upload full resolution images, and let it figure them out, unless

I have a restricted network connection.

-- glen

Link to comment
Share on other sites

(snip)

 

Whoaa! Won't that overwrite the original file with a smaller version?

 

It might be safer to use 'Save As' and change the filename slightly.

 

Having had trouble with Windows ill-thought-out Image Viewer in the past (saving a rotated version over the original without asking): I'd think twice about letting MS software go anywhere near my images.

 

I try to chmod mine to read only soon after I upload them to disk, so they won't accidentally be written over.

(They are on a SAN disk, NFS mounted to different machines in the house.)

 

For files with pixel length and width both multiples of 16, 90 degree rotations should be lossless.

Should be, but that doesn't mean all programs will do it.

 

Some steps work on 16x16 blocks, which change alignment for some resolutions.

-- glen

Link to comment
Share on other sites

For files with pixel length and width both multiples of 16, 90 degree rotations should be lossless.

Should be, but that doesn't mean all programs will do it.

 

Some steps work on 16x16 blocks, which change alignment for some resolutions.

 

Just to elaborate: JPEGs are encoded with a "lossy" compression scheme that throws away some (hopefully invisible) information in the interests of making the file smaller; the "quality" setting controls the "throwing away". The process is reversible - if you have an image compressed with a particular quality setting (at least with an appropriate implementation), decompress it by loading it into an editor, and then compress it again with the same settings, you shouldn't lose any information. If you recompress with a different quality setting, you probably will. Any aligned 16x16 sub-region, as Glen says, shouldn't be mangled if it wasn't touched between loading and saving.

 

GIMP (as recommended above) has a "use quality settings from original image" option during saving, which does this - it's useful if you only want to edit part of a picture. Other tools (such as jpegtran) can explicitly do 90 degree rotations and cropping (if the image is an appropriate size) without introducing more compression artifacts.

 

Generally, if you can start with a raw file, you probably should be doing so anyway. Even saved once as a JPEG, information is thrown away; the "lossless" edits we're talking about here are only lossless relative to the JPEG that's already been compressed. But if your once-in-a-lifetime image is a JPEG, it's useful to know.

Link to comment
Share on other sites

Just to elaborate: JPEGs are encoded with a "lossy" compression scheme that throws away some (hopefully invisible) information in the interests of making the file smaller; the "quality" setting controls the "throwing away". The process is reversible - if you have an image compressed with a particular quality setting (at least with an appropriate implementation), decompress it by loading it into an editor, and then compress it again with the same settings, you shouldn't lose any information. If you recompress with a different quality setting, you probably will. Any aligned 16x16 sub-region, as Glen says, shouldn't be mangled if it wasn't touched between loading and saving.

 

(snip)

 

I am not so sure about that one, but the rotates can be done with the already compressed 16x16 blocks,

without decompressing them. Also mirror reflections and cropping on lines between the blocks.

 

If the size is not a multiple of 16, a rotate could put partial blocks on the top or left, which requires

decompressing those blocks, then putting pixels from two old blocks together to make new ones.

I don't know which programs know how to do that, and which don't.

-- glen

Link to comment
Share on other sites

Yes, "decompressing" depends a bit on how your software works. Jpegtran works directly on JPEG files and can do rotates and flips (as you say, if the size is a multiple of the block size) just by moving coefficients around without ever producing RGB pixels; it can also do some scaling. GIMP works on an uncompressed image, but by recompressing with the same settings you can guarantee not throwing away any information that was already in the original JPEG - unless it's something you edited, or unless you've changed the block alignment by resizing.

 

Aside for the interested (still a short version because this is the beginner questions forum):

 

JPEG compression typically goes through the following stages:

  • Convert the image from RGB (technically nonlinear R'G'B') to Y'CbCr (colloquially "YUV"), where Y' represents brightness and the Cb and Cr define the yellow/blue and red/cyan offsets; collectively Cb and Cr define hue and saturation, although it's not quite the same as an HSV/HSL model.
  • The Cb and Cr channels are usually shrunk by a factor of two in each dimension (although this is configurable - GIMP's JPEG saver gives you control over this, as does ImageMagick; Photoshop only does this for quality 5 and below, I believe). The eye is more sensitive to detailed changes in brightness than colour, so for a lot of images this effect is hard to see. Because the Bayer filter in a camera typically only has one blue and one green sensor for every 2x2 sensor sites, you're probably not really losing much from a digital camera image in doing this. Scaling Cb and Cr by 2 each way gives you "4:2:0" encoding; not doing it is "4:4:4", and doing only one direction is "4:2:2" - you see these names sometimes in video specifications.
  • Each channel is broken into 8x8 square blocks, which are processed separately.
  • The values in each 8x8 block are put through a "discrete cosine transform" (DCT) which represents the block as a series of intensities of each frequency ("coefficients"); this is reversible (give or take numerical error), it's just a convenient representation for the next step.
  • Each value from the discrete cosine transform is scaled according to the quality setting, rounding the result. This is the main "lossy" bit of JPEG. Typically, the finer the detail the less you can see the exact intensity changes (you can see a twig is dark, but you can see how dark a branch is, for example), so you can throw this information away while having the result hard to see.
  • The numbers that result tend to be similar enough that they work nicely in a lossless compression scheme (typically Huffman, occasionally arithmetic) which gives you a nice small file, with some extra data in it telling you where sections start, how to reverse the quality scaling, etc.

(Actual implementations will overlap these a bit, and I'm ignoring things like progressive encoding.)

 

Decompression is the reverse:

  • Turn the losslessly compressed values into a series of DCT coefficients for each 8x8 block.
  • Scale the coefficients by reversing the effect of the "quality" control.
  • Reverse the DCT to get linear values.
  • Scale the results to get one value for each of Y', Cb and Cr for each pixel.
  • Convert the result to RGB

Programs like jpegtran only go as far as undoing the lossless compression and determining what the DCT coefficients are for each block; rearranging them lets you do the rotations and flips. This only works if you can keep the values local to the block, so if the image isn't a multiple of 16 pixels in size (or 8, for 4:4:4 images) and your change alters the relationship between pixels and blocks, it can't do this. It can also do a bit of scaling by some factors if the effect on the values in blocks is obvious, but not in general.

 

For GIMP's "use original coefficents" mode, let's take an example: say a particular output of the DCT when you first compress the image is (arbitrarily) 46, and your "quality" adjustment happens to scale it down by a factor of three; 46/3 is 15 (rounding down), and this gets stored in the JPEG. When you load the image back in, you get 15 x 3 = 45, which is close to but not quite the number you started with. However, if you then save it with the same settings, it's guaranteed still to be stored as 15, so it won't change no matter how often you open and close it.

 

If you were allowed to change your quality setting, you might take the value 46 and scale it by 3 to get 15, and after re-loading get the value 45. Then you might save at a higher quality with a scale factor of 2, giving you 45/2 = 22 (rounding down). Load that back to get 44, then if you save with a scale of 3 you might drop to 42, and so on - gradually getting farther from the original value. Even if you stick to the same quality setting, if your conversion isn't reversible (not all values at the quality setting return to the same thing when you load and save) the image can gradually get mangled. Example

. Jpegtran never modifies these values (it just rearranges them), so you know the quality won't be affected by its operations.

 

JPEG is designed so that the quality reduction from the compression should be hard to see, but if you do it repeatedly, or if you edit the image and amplify the sections that were previously "invisible", the quality problems can become intrusive fast - so ideally, only save to JPEG for the final image when you're trying to share it and the file size or compatibility with viewers is more important than preserving editability. If you do need to edit a JPEG, it's worth considering how you're applying edits to avoid introducing further compression artifacts. But I wouldn't lose too much sleep over it with a high quality JPEG and only a couple of minor edits, I just like being a perfectionist.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...