21 0
Contact Author Sign in to rate

Paste Images As WebP

2.57MB. Updated 2022-06-02.
The author has shared 10 other item(s).

Description

An Anki add-on that makes your images small. We all know that people who don't store their images in WebP are wasting a lot of disk space. Not only on their hard drives, but on AnkiWeb as well. Unfortunately Anki doesn't convert images to WebP when you paste them from elsewhere, and it takes time to convert and resize images manually. For the longest time I used a bash script to automatically convert images in my Anki collection to WebP until I decided that we simply need an add-on for this. WebP lossy images are 25-34% smaller than comparable JPEG images at equivalent SSIM quality index. Storing images in WebP is a great way to reduce the size of your Anki collection. Configuration To configure the add-on select AJT > WebP settings from the top menu bar. Usage Watch the video demonstration: After installation images will be automatically converted to WebP and resized on drag-and-drop. There's also a button in the Editor toolbar that lets you do the same. To bulk-convert existing images in your collection, select Edit > Bulk-convert to WebP in the card browser. You can see how it's done on . To rename media files on a particular note, open the Anki Browser, select the note and click on the pencil icon on the toolbar. A dialog will pop up asking you to enter new filenames. A demo showing how it's done is also available on . Support what I do I would not have been able to develop this add-on without the support of my patrons. Thanks so much! Join our community Want to discuss this add-on? Join the chat room. Contribute Click here if you would like to contribute on GitHub.

Download

As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

Supported Anki versions:

To download this add-on, please copy and paste the following code into Anki 2.1:

1151815987

If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

All Anki 2.1.x Add-Ons Contact Author

Reviews

on 1658600342
Excellent !!! Brillant !!! Effective !!!
on 1654388527
Essential for people with low storage, mainly in mobile devices
on 1650272756
Please add option to preserve aspect ratio and crop to `max_side_size`.
E.g., for image with `1200x600` or `1200x600` and `max_side_size = 1000`, we have `scale_ratio = max_side_size / max(1200, 600) = 1000 / 1200 = 5 / 6`.
I.e. `1200x600 → 1000x500`, `600x1200 → 500x1000`
Right now, if one specify `max_image_height = max_image_width = 1000` and convert `1200x1500` image, one get deformed `1000x1000` result.
Comment from author
The current version (4/18/2022) allows you to set one of the sides to 0. If it's not enough, please report any ideas in our chat.
on 1644266987
Thanks!
on 1643036813
Not so ideal as AVIF
https://jakearchibald.com/2020/avif-has-landed/
on 1640772821
Great idea, and very handy!
I'm wondering if its normal though, that all images become blurry if i do any kind of resizing when i paste the image? Even if i keep the aspect ratio constant.
Comment from author
Thank you for the feedback! If you crank image quality, the blurriness should go away.
on 1637088328
its a really good addon, Idk why but for me it can't convert some of the pics
Comment from author
GIF files are not supported by cwebp.
on 1634847764
Thanks for this amazing work of yours
on 1634826658
Extremely useful add-on, this should be default in the future
on 1633035958
Great add on, but as one other commenter has mentioned - why not AVIF if it's the better/more futere-proof format?
Comment from author
Anki and many other programs do not support this format yet. Maybe in the future.
on 1625229292
Is there also a solution for gifs? audios?
on 1620284993
thumbs up before using: how much % space will this save? i have over 50k images in my deck, several GB.. are transparent images transparent after converting? WebP work with ankidroid? please let me know id love to save space and they will probably load faster too? i want to use this to convert my entire 50k images but dont want any nightmares of messing up my working system
Comment from author
> how much % space will this save?
depends on your settings, but you can reduce the size by as far as 9 times, though the image quality will suffer.
> are transparent images transparent after converting?
By default - no, because transparency wastes disk space. But you can disable the blend_alpha option in the config.json file.
>WebP work with ankidroid?
Yes.
on 1617663871
Great addon! This should really be default in Anki, don't know how much they are paying to maintain the storage, but it would surely help.
on 1617186497
Works like a charm & is extremely effective! Love the fact you can completely configure it to your own needs and have the option to be asked for the settings with every insertation or not.. This really optimises the use of images in Anki indeed.

Thanks for introducing me to WebP and for your wonderfull add-on. It would be great if you have the option to determine the name of the image when pasting, so its management would be complete without the need for another add-on to rename the auto-generated file name.
on 1615314838
cool
on 1614763144
Works perfectly
extremely useful
Thank you very much
on 1612699175
Amazing addon! Thank you so much! Just an idea: It would be really nice if there was a bulk convert option, I don't know if it's possible though. Edit: Thank you so so much!
Comment from author before post was edited
I appreciate your review, and thanks for the amazing idea! It has been implemented in the latest release.
on 1611230816
Does this convert already existing images in collection.media? I use the Bulk Fetch Images from Google addon and was wondering if it could auto convert all the images this addon downloads. Great addon!
Comment from author
The add-on deliberately avoids processing internal pastes. Otherwise using Anki would become a nightmare ;)
However, in the latest release it is possible to bulk-convert images. To do it select the cards you want to process and press Edit > Bulk-convert to WebP.
on 1610895578
Nice plugin, thank you! Just one thing: Would it be possible to add an option for not upscaling images when pasting images lower than the specified sizes automatically, similar to the "ImageResizer" add-on? They could of course still be converted to webp though.
Comment from author
Great idea! It has been added in the latest version.
on 1610280175
This is a wonderful idea! Why don't we ask damien to implement it natively?
on 1609791864
thanks bro uve saved my harddrive