PHPackages                             sylvainjule/autofocus - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. sylvainjule/autofocus

AbandonedArchivedKirby-plugin[Image &amp; Media](/categories/media)

sylvainjule/autofocus
=====================

Content aware image cropping for Kirby

1.0.3(4y ago)391.7k↓80%2MITJavaScript

Since Dec 7Pushed 9mo ago2 watchersCompare

[ Source](https://github.com/sylvainjule/kirby-autofocus)[ Packagist](https://packagist.org/packages/sylvainjule/autofocus)[ RSS](/packages/sylvainjule-autofocus/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

> ⚠️ This plugin won't be maintained for Kirby 4+.

Kirby Autofocus
===============

[](#kirby-autofocus)

Content aware image cropping for kirby.

[![screenshot-autofocus-k3](https://user-images.githubusercontent.com/14079751/47998289-15b0f100-e0ff-11e8-8865-0267db33660d.jpg)](https://user-images.githubusercontent.com/14079751/47998289-15b0f100-e0ff-11e8-8865-0267db33660d.jpg)

Overview
--------

[](#overview)

> This plugin is completely free and published under the MIT license. However, if you are using it in a commercial project and want to help me keep up with maintenance, please consider [making a donation of your choice](https://www.paypal.me/sylvainjl) or purchasing your license(s) through [my affiliate link](https://a.paddle.com/v2/click/1129/36369?link=1170).

Autofocus is an extension for the [Focus plugin](https://github.com/flokosiol/kirby-focus).

This plugin acts as a JS `image.upload` hook, processing the / each image with the [focus component](https://github.com/component/focus), determining its appropriate focus point and saving it to the meta data file.

**Please note that :**

- This is an experimental plugin. The algorithm isn't foolproof, it works best with certain kinds of images, and obviously the more the context of an image is *« clear »*, the more its efficiency increases. I have included [a sample test with 30 images](https://github.com/sylvainjule/kirby-autofocus/blob/master/_test/test.md), as well as a way to run your own.
- The aim of this plugin is therefore to provide a *« better than nothing »* fallback to the Focus plugin whenever the editor didn't specify a focus point (omission, too many images, you name it).
- The plugin will only process images uploaded with the `files` section. It will not process replaced images. Suggestions welcome if you find a way to register a better hook.

Installation
------------

[](#installation)

> If you are looking to use this plugin with Kirby 2, please switch to the `kirby-2` branch.

First, you must install the [Focus plugin](https://github.com/flokosiol/kirby-focus).

> Note : the plugin would still work without it, but apart from adding the focus point to the .txt file, you wouldn't be able to preview / override / use it with the Focus methods.

Once it is done, download and copy this repository to `/site/plugins/autofocus`

Alternatively, you can install it with composer: `composer require sylvainjule/autofocus`

Usage
-----

[](#usage)

There's nothing else to do.

The plugin will now process any image you upload through the panel, find a focus point, and use the `flokosiol.focus.field.key` to write the coordinates. Then you can use the Focus plugin as you usually do.

Run tests
---------

[](#run-tests)

I have included [a sample test with 30 images](_test/test.md).

You can run you own tests to determine if the algorithm suits your needs. One simple way is to add the `focus` field in your blueprint, so that you can have a preview of where the focus is set for every image you upload.

An other way is to open the `index.html` of the `_test` folder in a browser, and upload an image. The images used for calculation will be displayed on the page, as well as the coordinates in the console.

Credits
-------

[](#credits)

- [@flokosiol](https://github.com/flokosiol/) for his great help with this extension.
- The [focus component](https://github.com/component/focus) is used to determine the focus point on upload.

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance41

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 95.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~391 days

Total

4

Last Release

1541d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14079751?v=4)[Sylvain Julé](/maintainers/sylvainjule)[@sylvainjule](https://github.com/sylvainjule)

---

Top Contributors

[![sylvainjule](https://avatars.githubusercontent.com/u/14079751?v=4)](https://github.com/sylvainjule "sylvainjule (20 commits)")[![tristantbg](https://avatars.githubusercontent.com/u/4832038?v=4)](https://github.com/tristantbg "tristantbg (1 commits)")

---

Tags

autofocuscropfocushookimagekirby

### Embed Badge

![Health badge](/badges/sylvainjule-autofocus/health.svg)

```
[![Health](https://phpackages.com/badges/sylvainjule-autofocus/health.svg)](https://phpackages.com/packages/sylvainjule-autofocus)
```

###  Alternatives

[flokosiol/focus

Better image cropping for Kirby CMS

18265.1k](/packages/flokosiol-focus)[sylvainjule/annotator

Place pins / define zones on an image synced with a structure field

10915.2k](/packages/sylvainjule-annotator)[tobimori/kirby-thumbhash

Kirby Image placeholders with the smarter ThumbHash integration

378.1k1](/packages/tobimori-kirby-thumbhash)[sylvainjule/imageradio

Add illustrations to Kirby's radio buttons

5916.8k](/packages/sylvainjule-imageradio)[timnarr/kirby-imagex

Modern images for Kirby CMS – This plugin helps you orchestrate modern, responsive and performant images in Kirby

797.5k1](/packages/timnarr-kirby-imagex)[felixhaeberle/kirby3-webp

Kirby 3 CMS plugin for converting JPG, JPEG and PNG into much smaller WEBP – speed up your website!

397.5k](/packages/felixhaeberle-kirby3-webp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
