how to compress jpeg to reduce size

Patton Echols p.echols at comcast.net
Sat Feb 5 23:49:50 UTC 2011


On 02/05/2011 03:12 PM, Thierry de Coulon wrote:
> On Saturday 05 February 2011 11:37:59 pm Tapas Mishra wrote:
>> I have an image which is 1.7Mb in size it is a scanned document.
>> I have to submit it online in an application where they do not accept
>> more than 1 Mb size JPEG
>> so how can I reduce the size of this image.Any format other than this
>> gif,png,jpg also is acceptable but
>> file size should be 1 Mb only.So how can I achieve this let me know if
>> some one has any suggestions for the same.
>>
>> --
>> Thanks
> Correct me if I am wrong, but:
> - jpeg _is_ compressed nearly as much as possible, so you can't compress it
> more (trying to usually results in a bigger file, actually)
> - jpeg is a lossy compression, so you can decrease the image size by
> decreasing the quality (Gimp lets you set this when saving a jpeg). You get a
> smaller file but a worse quality.

Yes, but not by as much as you might think.  I did a test starting with 
an image as it was saved by the camera like this:

$ convert DSC_1896.JPG -quality 93 DSC_1896-small.jpg

The original file was 2.7Mib, the resulting file was 1.1Mib.

Then look at the pictures, still using imagemagick

$ display DSC_1896*

This opens the viewer at full resolution (not squeezed into the display) 
then right click [next] to toggle.  I can't see any artifacts.

> - you can reduce the size of your picture (less pixels, less size) or the
> color depth.
> - you can combine all these options
>
> The best option depends on what you want to do with the picture.
>
> Gif is usually best for drawings with solid colors.
> I don't think that PNG has any size advantage,

PNG is non-destructive compression, but you pay a hefty size penalty.  
Normally about 2x the size of a jpeg in my experience.
Cheers,

--PE






More information about the ubuntu-users mailing list