docs/content/en/methods/resource/Fill.md
{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
The Fill method returns a new resource from a processable image according to the given processing specification.
[!note] Use the
reflect.IsImageResourceProcessablefunction to verify that an image can be processed.
When filling, you must provide both width and height (such as 500x200) within the specification. Fill maintains the original aspect ratio by resizing the image to cover the target area and cropping any overflowing pixels based on the anchor provided.
{{ with resources.Get "images/original.jpg" }}
{{ with .Fill "500x200 TopRight" }}
{{ end }}
{{ end }}
In the example above, "500x200 TopRight" is the _processing specification.
{{% include "/_common/methods/resource/processing-spec.md" %}}
{{ with resources.Get "images/original.jpg" }}
{{ with .Fill "500x200 TopRight" }}
{{ end }}
{{ end }}
{{< img src="images/examples/zion-national-park.jpg" alt="Zion National Park" filter="Process" filterArgs="fill 500x200 TopRight" example=true
}}