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.
JPG compression for High Altitude Balloon
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: JPG compression for High Altitude Balloon
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.
One could write a script to loop and try various quality settings until one reaches the desired filesize.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: JPG compression for High Altitude Balloon
-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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: JPG compression for High Altitude Balloon
OOPS! Thanks Anthony. I mistook that for the read size. So there is a way to specify the output file size. My mistake.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".