Page 1 of 1

JPG compression for High Altitude Balloon

Posted: 2013-03-19T17:57:54-07:00
by dronshaw
Working on a high altitude balloon project and needing to compress the JPG located on a Raspberry Pi. Cannot locate the best way to compress a ~50 - 75 kB JPG to around 7 kB. Hoping someone can point me in the right direction or give me advice.

Thanks for reading.

Re: JPG compression for High Altitude Balloon

Posted: 2013-03-19T18:19:38-07:00
by fmw42
I do not believe that Imagemagick has unique controls to set an image filesize. You need to adjust the -quality, -compression, etc to get what you want. See http://www.imagemagick.org/Usage/formats/#jpg_write

One could write a script to loop and try various quality settings until one reaches the desired filesize.

Re: JPG compression for High Altitude Balloon

Posted: 2013-03-19T18:49:49-07:00
by anthony
-define jpeg:extent={size}
As of IM v6.5.8-2 you can specify a maximum output filesize for the JPEG image. The size is specified with a suffix. For example "400kb".


However as fred pointed out this essentually just binary search on the 'quality' setting to find one that produces a file that is smaller than the given amount.

It is thus many times slower.

Re: JPG compression for High Altitude Balloon

Posted: 2013-03-19T18:57:50-07:00
by fmw42
anthony wrote:-define jpeg:extent={size}
As of IM v6.5.8-2 you can specify a maximum output filesize for the JPEG image. The size is specified with a suffix. For example "400kb".
OOPS! Thanks Anthony. I mistook that for the read size. So there is a way to specify the output file size. My mistake.