Quite pleased with this one. There are a few significant improvements in this version:
Notable changes:
- Fixed an issue affecting images with alpha channels, for example PNG files with transparency. Before, the extension would sometimes apply a wildly different accent colour than expected from backgrounds with alpha channels, because of a mistake I made when porting ColorThief into GJS. Particularly, I incorrectly assumed the pixel data of all
GdkPixbuf.Pixbufobjects were patterns ofr,g,b,r,g,b,..., when they can actually be this ORr,g,b,a,r,g,b,a,...-- this is a case of me not reading the documentation as much as I should have. I fixed this by (locally) adding an alpha layer to every image input, and treating every image as having anr,g,b,a,r,g,b,a,...pixel array pattern, like how its done in the original JS ColorThief project. Now, the correct colours should be parsed from every background applied, including those with or without alpha channels. - Converters like ImageMagick or librsvg are no longer needed for the extension to work on SVG and JXL files 🥳. Before, I thought these file types needed to be converted to JPG for ColorThief to work on them, however since fixing the problem affecting images with alpha channels, ColorThief seems to work perfectly on them -- no conversion required. It's slightly disheartening to realise the effort I put into making image converters work with the extension was completely unnecessary, had I just realised this flaw with handling images with alpha channels earlier. Whoopsie daisies. But now the problem is fixed, and the extension should fully run out of the box when installed -- no further steps needed.
- Fixed some cases where the program would crash and would need toggling off/on to run again. For example, when setting the
picture-uriorpicture-uri-darkkeys of theorg.gnome.desktop.backgroundschema to URIs that don't point to image files. - Made caching functions asynchronous. This will slightly improve performance, as GNOME shell will no longer freeze for the duration that (previously blocking) file operations are being performed.
- Newer calls to run Auto Accent Colour (based on a trigger like a wallpaper change, light/dark theme change, etc.) are no longer ignored when a background is already being processed. Now, the script will run again when this happens, and the results of older runs will be invalidated. This means an accent colour is always set based on the newest information only.