Donate to Remove ads

Got a credit card? use our Credit Card & Finance Calculators

Thanks to eyeball08,Wondergirly,bofh,johnstevens77,Bhoddhisatva, for Donating to support the site

How to compress jpg image

Seek assistance with all types of tech. - computer, phone, TV, heating controls etc.
ivahunch
2 Lemon pips
Posts: 159
Joined: November 13th, 2016, 5:07 pm
Has thanked: 33 times
Been thanked: 2 times

How to compress jpg image

#199699

Postby ivahunch » February 7th, 2019, 8:07 pm

I wish to compress a jpg image from 4MB to 100KB approx without reducing the dimensions. When I use MS Paint I keep reducing the dimensions so the image is too small.
DAK how to do this?

Itsallaguess
Lemon Half
Posts: 9129
Joined: November 4th, 2016, 1:16 pm
Has thanked: 4140 times
Been thanked: 10024 times

Re: How to compress jpg image

#199702

Postby Itsallaguess » February 7th, 2019, 8:17 pm

ivahunch wrote:
I wish to compress a jpg image from 4MB to 100KB approx without reducing the dimensions. When I use MS Paint I keep reducing the dimensions so the image is too small.

DAK how to do this?


Use GIMP -

https://www.gimp.org/

You can download it from here -

https://www.gimp.org/downloads/

Here's some instructions to help with your image-size-reduction request -

If you have images that take up a large space on disk, you can reduce that space even without changing the image dimensions.

https://docs.gimp.org/2.8/en_GB/gimp-tutorial-quickie-jpeg.html

Cheers,

Itsallaguess

kiloran
Lemon Quarter
Posts: 4108
Joined: November 4th, 2016, 9:24 am
Has thanked: 3242 times
Been thanked: 2846 times

Re: How to compress jpg image

#199708

Postby kiloran » February 7th, 2019, 8:28 pm

I find Gimp is complex and a large installation, about 200MB

I prefer IrfanView which is simple and just 2MB https://portableapps.com/apps/graphics_ ... w_portable

--kiloran

ReformedCharacter
Lemon Quarter
Posts: 3133
Joined: November 4th, 2016, 11:12 am
Has thanked: 3629 times
Been thanked: 1518 times

Re: How to compress jpg image

#199719

Postby ReformedCharacter » February 7th, 2019, 9:13 pm

ivahunch wrote:I wish to compress a jpg image from 4MB to 100KB approx without reducing the dimensions. When I use MS Paint I keep reducing the dimensions so the image is too small.
DAK how to do this?

You might also consider a file compression program such as the one built into Windows or 7-zip which offers more options.

https://www.7-zip.org/download.html

There's an online converter here:

https://onlineconvertfree.com/convert-f ... pg-to-zip/

RC

TedSwippet
Lemon Slice
Posts: 578
Joined: November 4th, 2016, 12:57 pm
Has thanked: 134 times
Been thanked: 299 times

Re: How to compress jpg image

#199730

Postby TedSwippet » February 7th, 2019, 9:49 pm

ReformedCharacter wrote:You might also consider a file compression program such as the one built into Windows or 7-zip which offers more options.

Unfortunately, zip and other file compressors won't help much, because the data in a jpg file is already compressed. In some cases, zipping a jpg file actually results in something larger than the original!

https://smallbusiness.chron.com/photos- ... 32137.html

There are a few online jpg compressors that might work here, for example tinyjpg.com, but that might not shrink the file enough to meet the stated requirement. If using gimp or similar, shrinking a 4mb jpg to 100kb will involve a significant sacrifice in image quality.

ClaudiusTheIdiot
Lemon Pip
Posts: 50
Joined: November 4th, 2016, 9:20 pm
Has thanked: 52 times
Been thanked: 11 times

Re: How to compress jpg image

#199734

Postby ClaudiusTheIdiot » February 7th, 2019, 10:01 pm

Also Nomacs
https://nomacs.org/
Save As.. and you can vary the file size while seeing the image quality then click OK to save.

staffordian
Lemon Quarter
Posts: 2300
Joined: November 4th, 2016, 4:20 pm
Has thanked: 1894 times
Been thanked: 870 times

Re: How to compress jpg image

#199749

Postby staffordian » February 7th, 2019, 10:39 pm

A second vote for IrfanView.

A compact and versatile program for all sorts of basic manipulation of images.

I agree Gimp is superb, and I use it for more complex image editing, but it's a relatively large program and anything but intuitive, and to simply resize images, it's a sledghammer to crack a nut.

gryffron
Lemon Quarter
Posts: 3633
Joined: November 4th, 2016, 10:00 am
Has thanked: 556 times
Been thanked: 1609 times

Re: How to compress jpg image

#199755

Postby gryffron » February 7th, 2019, 11:05 pm

ivahunch wrote:I wish to compress a jpg image from 4MB to 100KB approx without reducing the dimensions. When I use MS Paint I keep reducing the dimensions so the image is too small.
DAK how to do this?

No matter what software you use. You can't make the file smaller without losing some information.

So either you have to make the image smaller, reducing the number of pixels. Or you have to lose image detail. Most decent editors will let you specify the level of detail in a jpg, but mspaint won't. Reducing detail won't save you much though. Doubt you can reduce it by half before it starts to look manky.

BUT
You should be aware 4MB jpg is a very high quality image indeed. Better than the resolution of most computer screens, or an A4 sheet printed in photo quality. It would blow up to a large poster without any problem at all.
100k is usually adequate for a website picture, more than enough for social media.

You need to decide what resolution you really need and then use the software already suggested, or just mspaint, to reduce the image accordingly. But whatever you do and however you do it, a reduced file size will be a poorer image. The question is whether it is good enough for the job you want it for.

Gryff

GoSeigen
Lemon Quarter
Posts: 4403
Joined: November 8th, 2016, 11:14 pm
Has thanked: 1601 times
Been thanked: 1591 times

Re: How to compress jpg image

#199761

Postby GoSeigen » February 7th, 2019, 11:48 pm

ivahunch wrote:I wish to compress a jpg image from 4MB to 100KB approx without reducing the dimensions. When I use MS Paint I keep reducing the dimensions so the image is too small.
DAK how to do this?


Hard to propose the right solution until you explain exactly what you want, so:
1. Who is going to view or use the smaller file?
2. What do you mean by "dimensions"? Its appearance on the screen? Its size when printed? The resolution (number of pixels)?
3. How strict are the requirements? Would 200kB or 800kB be a showstopper?

Now a bit of mythbusting.
-there's nothing intrinsic to this situation preventing compression without loss. i.e. Contrary to some opinions, you most likely CAN compress the image without loss. However unless the image is very odd, the amount of compression possible will be small, perhaps 20%, which is no good for your stated target size.
-it doesn't matter how small or large in kB you make your image, you can display or print it at any size you like. It's just a matter of enlarging it for the final medium. HOWEVER, some image file formats can encode the resolution at which a file is intended to be displayed or printed, and IF one's display or printer follows those instructions the size will look right. Some software will allow you to set the display/print resolution when you change the file size but others will not. If your required use of the smaller file leaves you in control of the file you can vary its display size at will as stated earlier.



If your specifications were to be taken literally, there would be two main approaches to reducing the file size as drastically as you require. First, detail can be sacrificed by the software carefully merging the pixels in your image aka "resampling" the image. You will be left with fewer pixels, and smaller file size, but unfortunately if your software doesn't adjust the resolution (as it seems MSPaint doesn't) then you will notice the default display size is also reduced as observed in the OP. The other approach is to preserve the same number of pixels, but allow the JPEG compression algorithm to reduce file size by sacrificing picture quality. This typically results in visible artefacts when the file is viewed, often localised to certain parts of the image (e.g. near sharp edges). Normally your eye would not notice these artefacts but with severe compression they could become easily visible or even annoying. In practice a combination of the two approaches will be likely be necessary i.e. reduce number of pixels AND increase level of JPEG compression. The extent of file size reduction you require means there will almost certainly be a noticeable loss of quality.

Sorry, can't recommend specific software, but there are some suggestions in earlier posts, and you may get more if you can answer the three questions above.


GS

Breelander
Lemon Quarter
Posts: 4179
Joined: November 4th, 2016, 9:42 pm
Has thanked: 1001 times
Been thanked: 1855 times

Re: How to compress jpg image

#199766

Postby Breelander » February 8th, 2019, 12:23 am

ivahunch wrote:I wish to compress a jpg image from 4MB to 100KB approx without reducing the dimensions...


IrfanView as suggested by Kiloran is easy to use for this. I use PaintShop Pro for almost all my image processing, but I've been hearing good things about IrfanView and took this excuse to try it out.


GoSeigen wrote:...allow the JPEG compression algorithm to reduce file size by sacrificing picture quality. This typically results in visible artefacts when the file is viewed, often localised to certain parts of the image (e.g. near sharp edges)...



Most of what you say I agree with, but I beg to differ on this one point. The JPEG algorithms try to preserve edges at the expense of large areas of similar colour. It's in such areas (eg. a blue sky) that the blocky compression artefacts tend to be most noticeable.

Here's one of my own photos. The original was a 3.8MB JPEG and I compressed it to 400KB without reducing its resolution (2448x3264) The image to the right is the whole photo, the images to the left are the selected section in the original. The upper left is from the 3.8MB original, the lower left from the 400KB compressed version. Click on the image to see it on Imgur where you can enlarge it. Notice the blocks in the shadow areas.

Image

BobGe
Lemon Slice
Posts: 554
Joined: November 5th, 2016, 12:49 am
Has thanked: 176 times
Been thanked: 125 times

Re: How to compress jpg image

#199769

Postby BobGe » February 8th, 2019, 12:58 am

If you only need to do this occasionally there are plenty of on-line utilities, e.g.:
http://jpeg-optimizer.com/
https://compressjpeg.com/
https://compressimage.toolur.com/
https://tinyjpg.com/

Or you can Google it...

GoSeigen
Lemon Quarter
Posts: 4403
Joined: November 8th, 2016, 11:14 pm
Has thanked: 1601 times
Been thanked: 1591 times

Re: How to compress jpg image

#199770

Postby GoSeigen » February 8th, 2019, 12:59 am

Breelander wrote:Most of what you say I agree with, but I beg to differ on this one point. The JPEG algorithms try to preserve edges at the expense of large areas of similar colour. It's in such areas (eg. a blue sky) that the blocky compression artefacts tend to be most noticeable.


I stand corrected. The example I chose was something of a guess...


GS

ivahunch
2 Lemon pips
Posts: 159
Joined: November 13th, 2016, 5:07 pm
Has thanked: 33 times
Been thanked: 2 times

Re: How to compress jpg image

#199788

Postby ivahunch » February 8th, 2019, 7:31 am

Hard to propose the right solution until you explain exactly what you want, so:
1. Who is going to view or use the smaller file?
2. What do you mean by "dimensions"? Its appearance on the screen? Its size when printed? The resolution (number of pixels)?
3. How strict are the requirements? Would 200kB or 800kB be a showstopper?


Answering GoSeigen's questions

1) For viewing on a website
2) I meant its size on the screen
3) A maximum of 120KB

Thanks

GoSeigen
Lemon Quarter
Posts: 4403
Joined: November 8th, 2016, 11:14 pm
Has thanked: 1601 times
Been thanked: 1591 times

Re: How to compress jpg image

#199826

Postby GoSeigen » February 8th, 2019, 9:54 am

ivahunch wrote:
Hard to propose the right solution until you explain exactly what you want, so:
1. Who is going to view or use the smaller file?
2. What do you mean by "dimensions"? Its appearance on the screen? Its size when printed? The resolution (number of pixels)?
3. How strict are the requirements? Would 200kB or 800kB be a showstopper?


Answering GoSeigen's questions

1) For viewing on a website
2) I meant its size on the screen
3) A maximum of 120KB

Thanks


Okay thanks, that ties it down a lot. I infer:

-You'll almost certainly need both a lower resolution image AND higher jpeg compression setting.
-Assuming you have no control of the web page, you'll want the resolution/size settings in your image file to be set correctly [which MS paint is not doing]

Hopefully you've now identified suitable software capable of doing both the above correctly and easily, or someone will suggest.


Just some practical points about how to choose the resolution/pixel size of the image and the level of jpeg compression. Believe it or not, this is a complex issue. But to simplify it:
-set a resolution for your image of 72dpi, which is pretty standard for displays. Thus if you want the image roughly four inches wide, get the image software to resample (reduce the size of) your image to 72x4=288 pixels across. Most software will automatically set the height to preserve the aspect ratio of the picture without your having to calculate it.
-If you save now in JPEG format the file size should be dramatically smaller. If it's achieved your target of 120kB then you can go to the final step below. Otherwise you will need to change the jpeg compression factor before saving again, increasing it gradually until your target file size is achieved. This setting is often in the save dialog.
-final step is to check the image displays correctly and if not, change the relevant settings in the image software to specify what size the image should be displayed at. This should not alter the image at all but just adds information (metadata) to the saved file which the web page or software displaying the image can read. How you perform this setting in an image editor varies; it is often done as part of the image resizing step (but sometimes automatically without user input -- you probably want to avoid software which does this).


When you've mastered the process, ideally do all the above steps together in one go working from the original image and saving your output file to JPEG format only once. (If you save as JPEG multiple times it is likely you'll needlessly degrade the image quality each time you save.)

Also, while working on the above, set your image software to always display your image for you at its "actual size", not zoomed in or out: then you will see how the changes you are making will affect how the image will finally be displayed.


[My image software has a single dialog where you set the pixel width/height of the image AND the resolution. The former alters the image itself by resampling. The latter setting just gets saved to the file and tells the displaying software how large to display the image. So for a 4 inch wide image I'd set the width to 288 and the resolution to 72. Then I get to set the jpeg compression level in the Export/Save As... dialog where I can choose jpeg format and a quality setting.]

Good luck.

GS

kyu66
2 Lemon pips
Posts: 248
Joined: November 14th, 2016, 5:14 pm
Has thanked: 2 times
Been thanked: 131 times

Re: How to compress jpg image

#199828

Postby kyu66 » February 8th, 2019, 9:57 am

ivahunch wrote:Answering GoSeigen's questions

1) For viewing on a website
2) I meant its size on the screen
3) A maximum of 120KB

Thanks

A third vote for IrfanView.

It sounds like you need to reduce the size and the dimensions.

For viewing on a website you only need max 1200 pixels along the long edge, so reduce the dimensions first, then use the JPEG compression settings to reduce the file size to your 120KB.

Here is a link to the result of a Google search showing the required steps
https://www.bleepingcomputer.com/forums ... irfanview/

Edit: Make sure you keep a copy of the original file, i.e. don't overwrite it. Name the output file so it is obvious it is for the web/lower resolution/size etc.

ten0rman
Lemon Slice
Posts: 525
Joined: November 4th, 2016, 9:16 pm
Been thanked: 169 times

Re: How to compress jpg image

#199938

Postby ten0rman » February 8th, 2019, 3:03 pm

This may be a bit (ahem) too complex, but it's what I do when copying stuff with the scanner, or when I have to reduce file sizes because the recipient can't (or more likely, won't) receive them.

After scanning, I save it as a png file which is lossless. Next, I open the file with, in my case, Gimp, make any changes, eg cropping, and then export in whichever format I desire. If exporting as jpg, I then set the compression as necessary. If that doesn't seem ok, I thenrepeat the export a different compression. That way, the original only suffers one lot of compression.

If attempting to reduce a jpg, which by its very nature has been compressed at least once, I use a similar system, until I get what I want. That way, at most the "whatever" only suffers two lots of compression, the original, and mine.

Gimp as standard exports at 95%. On occasion I have had to reduce that to 80% to get the "whatever" down to a reasonable size.

Ok, I know it's messy, but it works for me and after the first few times is reasonably quick.

Regards,

ten0rman


Return to “Technology - Computers, TV, Phones etc.”

Who is online

Users browsing this forum: No registered users and 26 guests