Sha256: 13576af18ded7b21b3106056907c66ded39ab37c2536b3712d810aad25527d12

Contents?: true

Size: 1.08 KB

Versions: 9

Compression:

Stored size: 1.08 KB

Contents

---
sort: 3
---

# Crop

Crop an image to a given aspect ratio. This argument is given as a `crop` and (optionally) a `keep`
setting. The values given here will override the preset settings (if present), can be given after
every image, and apply only to the preceding image.

`crop` is given as an aspect ratio in the `width:height` format.

`keep` sets which portion of the image to keep; it's the
['interestingness'](https://libvips.github.io/libvips/API/current/libvips-conversion.html#VipsInteresting)
setting passed to the [libvips
smartcrop](https://libvips.github.io/libvips/API/current/libvips-conversion.html#vips-smartcrop)
function. Your options are:

* `attention` - automagically keep parts likely to draw human attention. **Default**
* `entropy` - Crop out the parts with the least variation.
* `center` or `centre` - Keep the middle part.

```note
Cropping happens before resizing; the preset `widths` setting is a post-crop value.
```

More fine-grained control is beyond the scope of this plugin. I'm not writing an image editor here!

## Examples

- `16:9`
- `1:1 entropy`
- `3:2 center`

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
jekyll_picture_tag-2.1.2 docs/users/liquid_tag/argument_reference/crop.md
jekyll_picture_tag-2.1.1 docs/users/liquid_tag/argument_reference/crop.md
jekyll_picture_tag-2.1.0 docs/users/liquid_tag/argument_reference/crop.md
jekyll_picture_tag-2.0.4 docs/users/liquid_tag/argument_reference/crop.md
jekyll_picture_tag-2.0.3 docs/users/liquid_tag/argument_reference/crop.md
jekyll_picture_tag-2.0.2 docs/users/liquid_tag/argument_reference/crop.md
jekyll_picture_tag-2.0.1 docs/users/liquid_tag/argument_reference/crop.md
jekyll_picture_tag-2.0.0 docs/users/liquid_tag/argument_reference/crop.md
jekyll_picture_tag-2.0.0pre1 docs/users/liquid_tag/argument_reference/crop.md