<p>There's no way of doing that natively. </p>

<p>When you're cropping an image with Craft, it zooms in as little as possible.  So, if you have an image that's 800x600 and you crop a square at 500x500, Craft won't zoom in at all.</p>

<p>When cropping is finished, the next task is to get the focal point as close to the center of the final image without crossing out of bounds.</p>

<p>Consider if Craft tried to put the focal point in the center no matter what. If the focal point was 100 pixels away from an edge and you wanted a square of 300x300, that would result in 1.5x zoom which would be a less desired outcome for many people.</p>

CC BY-SA 4.0
2018-10-11T12:36:05.400Z
2018-10-11T12:46:11.520Z
2018-10-11T12:46:11.520Z
Andris Sevcenko
<p>I originally had this setting in twig for gallery thumbnails:</p>

<pre><code>{% set square150 = {
    mode: 'crop',
    width: 150,
    height: 150,
    quality: 75
    position: 'center-center'
} %}

&lt;img width="{{asset.getWidth(square150)}}" height="{{asset.getHeight(square150)}}"&gt;
</code></pre>

<p>I noticed focal point doesn't apply, so I removed the position property as described on <a href="https://docs.craftcms.com/v3/image-transforms.html" rel="nofollow noreferrer">https://docs.craftcms.com/v3/image-transforms.html</a></p>

<p>So now it's </p>

<pre><code>{% set square150 = {
    mode: 'crop',
    width: 150,
    height: 150,
    quality: 75
} %}
</code></pre>

<p>and the focal point works (I'm writing this out here because it took me some time to find out).</p>

<p>But it seems to me that the cropping is kind of generous, the area of the thumbnail is quite large. It does contain the focal point, true. But the focal point isn't always in the center of the image, as I'd have expected.</p>

<p>I'm sure the current behaviour is fine for many use cases.</p>

<p>In mine, what I'd expect is that for the focal cropping, the extract of the image is zoomed in so far that the focal point is in the center.</p>

<p>So something like...</p>

<pre><code>{% set square150 = {
    mode: 'crop',
    width: 150,
    height: 150,
    quality: 75
    position: 'focal-point-center-center'
} %}
</code></pre>

<p>Is that possible and did I interpret the behaviour correctly?</p>

CC BY-SA 4.0
2018-10-05T07:32:56.407Z
PS I'd rather stay with native functions
Urs
<image-transforms><image>
Focal point: more control?
# Focal point: more control?

(Asked by: username_0 on 2018-10-05)

I originally had this setting in twig for gallery thumbnails:
{% set square150 = {
    mode: 'crop',
    width: 150,
    height: 150,
    quality: 75
    position: 'center-center'
} %}



I noticed focal point doesn't apply, so I removed the position property as described on https://docs.craftcms.com/v3/image-transforms.html
So now it's 
{% set square150 = {
    mode: 'crop',
    width: 150,
    height: 150,
    quality: 75
} %}

and the focal point works (I'm writing this out here because it took me some time to find out).
But it seems to me that the cropping is kind of generous, the area of the thumbnail is quite large. It does contain the focal point, true. But the focal point isn't always in the center of the image, as I'd have expected.
I'm sure the current behaviour is fine for many use cases.
In mine, what I'd expect is that for the focal cropping, the extract of the image is zoomed in so far that the focal point is in the center.
So something like...
{% set square150 = {
    mode: 'crop',
    width: 150,
    height: 150,
    quality: 75
    position: 'focal-point-center-center'
} %}

Is that possible and did I interpret the behaviour correctly?

**Tags:** image-transforms, image

> **Comments:**
> **username_0**: PS I'd rather stay with native functions  

---

## 1 answers

### Answer by username_1 on 2018-10-11. Score: 2 | Accepted answer

There's no way of doing that natively.

When you're cropping an image with Craft, it zooms in as little as possible. So, if you have an image that's 800x600 and you crop a square at 500x500, Craft won't zoom in at all.

When cropping is finished, the next task is to get the focal point as close to the center of the final image without crossing out of bounds.

Consider if Craft tried to put the focal point in the center no matter what. If the focal point was 100 pixels away from an edge and you wanted a square of 300x300, that would result in 1.5x zoom which would be a less desired outcome for many people.


---

