Description
GitHub | Documentation | Changelog | Support
Takopic optimises the images of your media library with the libraries of your own server: jpegoptim, optipng or oxipng, pngquant, cwebp and avifenc, or GD and Imagick for the WebP and AVIF formats. Free and unlimited, no API key, no quota: your images never leave your server.
Optimisation
- Compresses JPG and PNG images in place, and creates their WebP and AVIF versions, kept only when lighter.
- Keeps the original images, to restore them at any time.
- Strips the metadata (camera, date, GPS position), but keeps the colour profile when the colours need it.
- Handles CMYK JPGs and the photos stored sideways.
Media library
- Optimises the images on upload, or the whole library in the background, with pause and cancel.
- Re-optimises the images left behind by new settings or new image sizes of the theme.
- Shows the status, the errors and the bytes saved of each image, and optimises or restores it in one click.
On the site
- Serves AVIF and WebP with the JPG or PNG as fallback: in a
<picture>element, or from the server with rewrite rules (Apache, nginx). - Tests the delivery.
For developers
takopic_image()andtakopic_image_sources()give the<picture>of an image or its srcsets, in your own templates.- WP-CLI:
wp takopic run,clean,restore,statsandhealth. - Filters for the folder of the originals, the priority and threads of the libraries, the pace of the background jobs and the path of a library.
All of them are documented in the README on GitHub.
Privacy
- No external request: no API, no tracking. The delivery test only requests the images of the site, from its CDN if they are served by one.
- No metadata: the optimised images lose it, GPS position included. The originals keep it.
- Private originals: kept in
uploads/takopic/originals-{key}/, under a key drawn at random for each site. Takopic closes the folder to the web with a.htaccesson Apache and LiteSpeed; on nginx, add the rules of the Delivery tab.Test the deliverychecks it on both. - Originals out of the web root: set their folder with the
takopic_backup_dirfilter, before optimising any image. Takopic does not move the originals already kept: move the folder yourself when you change it.
Credits
Takopic is developed by Clément Gayot.
It started as a fork of Squidge, created by Ainsley Clark in 2021 with contributions from Roman K, Rohinish and karbivskij, and was largely rewritten in 2026. Many thanks to them for the foundations: the idea of relying on the native libraries of the server comes from Squidge.
Thanks also to Media Optimizer by YooHW for some ideas: the menu, the delivery page, the display of the bytes saved, and more.
Screenshots





Installation
In Plugins > Add New Plugin, search for Takopic, then install and activate it.
After installing:
- The new uploads are optimised right away:
Optimise new uploads, ticked by default. - The images already in the library wait in the Optimise tab:
Optimise new imagesoptimises them in the background. - The Overview tab lists the missing libraries, and how to install them.
- WebP and AVIF are not served until you turn them on in the Delivery tab.
Takopic needs PHP allowed to run the libraries of the server (proc_open() or exec()):
- JPG:
jpegoptim. Without it, not compressed. - PNG:
optipngoroxipng(faster). Without them, not compressed. - PNG lossy (optional):
pngquant. Without it, lossless only. - WebP:
cwebp. Without it, GD or Imagick, with heavier PNG graphics. - AVIF:
avifenc. Without it, GD or Imagick (WordPress 6.5+), with less sharp colours.
On Debian or Ubuntu: sudo apt install jpegoptim optipng webp libavif-bin.
On Windows: no JPG and PNG compression. For WebP and AVIF, put the official builds of cwebp and avifenc on the PATH, or set their path with the takopic_binary_path filter.
FAQ
-
Does Takopic replace my images?
-
By default, yes: the JPG and PNG files are replaced by their compressed version, and the originals are kept in
uploads/takopic/originals-{key}/.Restore original imageson the settings page, orRestore originalon an image of the media library, puts them back. To only make the WebP and AVIF versions, untickCompress JPG imagesandCompress PNG imageson the Settings tab. -
Does it serve WebP and AVIF automatically?
-
Once turned on in the Delivery tab, in one of two ways:
- In the HTML: the images of the content and of
wp_get_attachment_image()(featured images, galleries, most themes) are wrapped in a<picture>element, with the JPG or PNG as fallback. Works everywhere, but may break a layout stylingimgdirectly. In a custom theme, usetakopic_image(). - From the server: the server answers
photo.jpgwith its AVIF or WebP version when the browser reads it. The HTML does not change, and CSS backgrounds are served too. Takopic writes the rules inuploads/.htaccesson Apache and LiteSpeed; on nginx, add the ones given on the Delivery tab, or in the README.
A CDN must vary its cache on the
Acceptheader, or serve the JPG to everyone.Test the deliverychecks what the server sends. - In the HTML: the images of the content and of
-
What happens when the theme changes its image sizes?
-
Its images are listed as “Older settings”:
Re-optimise outdated imagesmakes their thumbnails again from the originals, and optimises them. -
Does it slow the site down?
-
The background jobs run the libraries at the lowest priority, behind the requests of the site. On a small server, the filters slow them down further.
-
Yes for WebP and AVIF, made by GD or Imagick when the libraries are missing. The JPG and PNG compression needs the libraries, which most shared hosts do not let you install: ask your host. The Overview tab tells what is missing.
-
What happens when I deactivate or delete Takopic?
-
Deactivated, Takopic stops its background job and removes its rewrite rules: the site serves the JPG and PNG images again. Its settings and files stay, and the rules come back on activation.
Deleted, Takopic removes its settings and data from the database, but leaves the files: the compressed images, their WebP and AVIF versions and the originals. To get the originals back, run
Restore original imagesbefore deleting it.Before deactivating, a dialog shows how many images Takopic has optimised and the size of
uploads/takopic/, with a button to restore the originals, and warns when the theme callstakopic_image(): its pages break while Takopic is deactivated. With nothing to warn about, Takopic deactivates at once.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Takopic – Local Image Optimizer | Convert WebP & AVIF” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Takopic – Local Image Optimizer | Convert WebP & AVIF” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.1
- Images no longer listed as “Older settings” for a thumbnail size a plugin registers but never makes:
Re-optimise outdated imagesputs them back as optimised, without encoding them again. - WP-CLI prints its welcome first, even when the theme or a plugin holds the output back.
wp takopic runnumbers the images it processes, with their ID, e.g.Processing image 10/256: Sunset (ID 147).- The counts of the images stay right with a persistent object cache that missed a change made elsewhere, e.g. by WP-CLI.
- The numbers the settings page updates are written as WordPress writes them, e.g.
1 044in French, not1,044.
The older versions, and those of Squidge before Takopic, are in the full changelog.
