WebP on RISC OS
About WebP
WebP — capitalised thusly — is a graphics format developed by Google intended as a replacement for JPEG, PNG and GIF formats; most modern browsers can handle WebP images. The format supports both lossy and lossless compression, as well as animation and an alpha channel. WebP files may contain metadata (in ICCP, EXIF or XMP formats) such as a thumbnail image and technical details such as the camera settings used.
WebP was first fully released in 2018, and since then has been getting progressively more widespread on the web. It claims to have various advantages over previous formats, chiefly in reduced file size (though there is criticism regarding fidelity). The following table shows how its usage on the web has been increasing, expressed as the percentage of websites which use the format:
| 2020 | 2021 | 2022 | 2023 | 2024 | 2025 (Jan) | 2025 (Oct) |
| 0.2% | 0.5% | 3.0% | 6.5% | 10.8% | 14.9% | 17.9% |
[Source: https://w3techs.com/ … w/image_format/all/y ]
WebP on RISC OS
The WebP format is now fairly well supported on RISC OS, at least for still images. PhotoDesk (3.23) can load and save them, and there are the free stand-alone conversion applications Spr2WebP and WebP2Spr courtesy of Richard Coleman, who did the hard work — see Links section below. It’s also been reported that the RISC OS port of ImageMagick 7 can be used to convert WebP files to and from sprites.
RISC OS web browsers which can render static WebP images include NetSurf and Iris.
Animation support is much more limited. As far as I know no-one has ported Google’s img2webp to RISC OS; this can produce animations from a sequence of still images. There are however various online converters.
On RISC OS, the Iris browser can render animated WebP files, but NetSurf can’t.
WebP files have an official filetype of &a66, with type name WebP. The extension is “filename.webp”, and the details should be included in your mimemap file. To check:
- Open a task window (Ctrl-F12)
- Type:
mimemap webp
If you see the message “No MIME mapping found” you need to add it as follows:
- Type:
filer_run inetdbase:mimemap
- Your system’s mimemap should open in an editor window
- Look for the “image”+”IANA registered” section, and add the following line (the gaps are tabs):
image/webp WebP a66 .webp
- Save the file; the setting will take effect after the next boot
Examples
I’m using a couple of images to demonstrate WebP. The flowers picture is a 1280×1280 detail from a photo taken in Zambia by a Canon Ixus, so originally a JPEG. The screengrab image (732×714, 24-bit RGB) is from my in-progress app for reporting on our solar panel installation. These were saved as sprites (which is lossless, of course), and then converted into various formats using various apps and settings.
NB: The images below (in WebP format — if you can’t see them your browser doesn’t support the format) are not the actual images used, they’ve been resized and are just for reference. You can download the original sprite files in the Links section below.
|
|
The WebP conversions were done with Spr2Webp, using the settings of Photo and Lossless (for the flowers) and Picture and Drawing (the screengrab). You can also use PhotoDesk, but this uses the same code as Spr2Web so the sizes are pretty much identical. Lossless takes longer (but you’ll usually only need to do it once).
The JPEGs were done with Paint, with the quality settings in parentheses.
The PNGs of the flowers are provided for interest only, as you wouldn’t normally save a photo in this format. Paint and Spr2Png produce identical output, with compression set to 9 in both cases. Paint uses RISC OS’ internal PNG library, while Spr2Png has its own converter.
Of more interest are the PNG entries for PhotoDesk. The first, labelled “PhotoDeskA”, uses the default settings when saving a PNG from PhotoDesk, and they are actually larger than the sprite, possibly due to being interlaced. The second (”PhotoDeskB”) has the settings tweaked. This isn’t straightforward, as the save box doesn’t include any options to change parameters. You have to shift-click on the !PhotoDesk app to open it, then on “Resources”, then on “Formats”, then shift-click on “!3PNG”. Open the directory “Options”, then load “spr2png” which should contain just the text “-ia” (without the quotes). Change this to “-ia9” — the “9” increases compression — and save. Doing this improves the compression markedly, though still not as good as Spr2Png. You could probably improve things more by modifying the options; PhotoDesk’s PNG library is very similar to that used by Spr2Png. Or more simply, as PhotoDesk appears to perform negative compression on PNGs, save as a sprite and drop the icon on Spr2Png. Or load it into Paint and save as a PNG from there.
Summary
It’s quite hard to see much visual difference between these images, with the exception of the JPEG (75) version of the screengrab, where artefacts are visible in colour transitions.
For photographs, WebP in Photo mode is the most efficient, for both lossy (JPEG equivalent) and lossless transmission/storage.
For line drawings or screengrabs use WebP with Picture or Drawing presets.
If you need maximum portability under RISC OS, especially legacy versions, JPEG and PNG are still the best options.
Links
WebP on Google, on Wikipedia
Richard Coleman’s conversion apps (webp2spr, spr2webp and webpinfo, along with desktop front ends)
Darren Salt’s Spr2Png and Png2Spr apps
PhotoDesk is available via the !Store app
Example images as used above (4Mb zipped sprites)
Gradgrind Update
The Gradgrind palette editor for RISC OS has been updated, with a minor bug fix for hex display of colour values.
Download link: Gradgrind 0.91 beta (326k)
Work in progress: !Solar
We’ve had solar panels for nearly 14 years now, and the output has been reported daily on our site. The page is currently generated by a Python program running on a Raspberry Pi (a Pi400 at the moment), but I’ve been working on a version running under RISC OS, using BBC BASIC. Here are some samples of the output:
It’s unfinished as yet, but work continues slowly…
Accessing Met Office DataHub forecasts from a Raspberry Pi
Introduction
As the Met Office is discontinuing their DataPoint service in late 2025, we’ve recently been converting our weather forecasts page to use DataHub, the replacement service. This provides forecasts in GeoJSON format, and gives much more information and better global coverage than DataPoint did. Here we’ll describe how to access the forecasts from a Raspberry Pi, using Python.
Registering
Like DataPoint, DataHub is mostly free for non-commercial and non-bulk usage. Various types of data are available, and we’re using the global spot 3-hour site-specific forecast. This is free providing you access it fewer than 360 times per day.
DataHub requires you to register, whereupon you’ll be given an api-key. This is a string of characters, and is very long! Over 1600 characters, in our case. Store this somewhere secure and safe.
Getting some data
Gradgrind
Gradgrind is a palette generator which takes particular care to create smooth blends between colours. The palettes are generated by curve-fitting rather than linear interpolation (using Catmull-Rom splines, if you’re interested), and can be created and saved as script files as well as edited interactively.
It can create greyscale palettes, which can be particularly useful when loaded into PhotoDesk and used as displacement maps or effect gradients. PhotoDesk can only generate linear blends, which can give visible artefacts, discontinuities and banding.
The program comes with full documentation and example gradient scripts.
Gradgrind is a RISC OS program. It will not run under any other OS.
This is a beta version, 0.90. It was written and developed under RISC OS 5.31. Prior versions of the OS may work; feedback is appreciated.
Download link: Gradgrind 0.90 beta (325k)








