Author Topic: Uk Metoffice FAX chart tif conversion script  (Read 75 times)

0 Members and 1 Guest are viewing this topic.

Offline Supercell

  • Member
  • *
  • Posts: 23
    • Dublin Weather
Uk Metoffice FAX chart tif conversion script
« on: Yesterday at 12:48:02 PM »
I'm planing to add a page to my website which incorporates the freely available UK Met Office Fax Charts posted to the NOAA ftp
I'm running Weewx on a Raspberry Pi (Raspbian)and want to do this in a simple script called by cron every few hours.
So the script just gets the tifs from tgftp.nws.noaa.gov then converts them to png and uploads the resultant files to the website page.

I'm finding though that the resultant png's are larger than the original tifs and was wondering if someone has a better suggestion on how to convert to png/jpg/gif smaller than original size whilst retaining decent quality? Loooking at other sites doing this gif's seem to be popular but my experiments with gif's (converting with ffmpeg  or imagemagick)are giving much bigger files.

As an example at the moment i'm doing the following :

Code: [Select]
convert PPVA89.TIF -depth 2 -type bilevel -rotate 270 -resize 1076 -quality 100 PNG8:PPVA89.png
This gives me a png of around 110kb compared to the original 66kb which while ok I feel could be much better for a black and white image.
Grateful for any advice!
 

Offline Bushman

  • Forecaster
  • *****
  • Posts: 6829
    • Eagle Bay Weather
Re: Uk Metoffice FAX chart tif conversion script
« Reply #1 on: Yesterday at 01:49:38 PM »
Dump the alpha channel (-alpha) and extra stuff with -strip

Offline Supercell

  • Member
  • *
  • Posts: 23
    • Dublin Weather
Re: Uk Metoffice FAX chart tif conversion script
« Reply #2 on: Today at 04:06:39 AM »
Thanks Bushman , that knocked off 10kb, every little helps!

 

anything