Configure imaging
Configure imaging.
Processing options
These are the default settings for processing images:
imaging:
anchor: Smart
bgColor: '#ffffff'
compression: lossy
hint: photo
quality: 75
resampleFilter: box
[imaging]
anchor = 'Smart'
bgColor = '#ffffff'
compression = 'lossy'
hint = 'photo'
quality = 75
resampleFilter = 'box'
{
"imaging": {
"anchor": "Smart",
"bgColor": "#ffffff",
"compression": "lossy",
"hint": "photo",
"quality": 75,
"resampleFilter": "box"
}
}
- anchor
- (
string) The focal point of the crop box when cropping or filling an image. Valid options includeTopLeft,Top,TopRight,Left,Center,Right,BottomLeft,Bottom,BottomRight, orSmart. The default isSmart, which identifies the most interesting area of the image based on the smart cropping algorithm implemented in thesmartcrop.jslibrary. - bgColor
- (string) The background color of the resulting image. This applies when converting an image with transparency to a format that does not support it, such as when converting from PNG to JPEG, or when rotating an image by a non-orthogonal angle into a non-transparent format. In these cases, this color fills the empty space created as the image extents increase to fit the rotated corners. The value must be an RGB hexadecimal color. Default is
#ffffff. - compression
- New in v0.153.5
- (
string) The compression method used when encoding an image. Valid options includelosslessorlossy. Thelosslessmethod is only applicable to WebP images. Default islossy. - hint
- (
string) The encoding preset used when processing WebP images, equivalent to the-presetflag for thecwebpencoder. Valid options includedrawing,icon,photo,picture, ortext. Default isphoto.Value Example drawingHand or line drawing with high-contrast details iconSmall colorful image photoOutdoor photograph with natural lighting pictureIndoor photograph such as a portrait textImage that is primarily text - quality
- (
int) The quality of the resulting image, applicable to JPEG and WebP images when using lossy compression. The format isqQUALITYwhereQUALITYis a whole number between1and100, inclusive. Default is75. - resampleFilter
- (
string) The filter used to calculate new pixels when when resizing, fitting, or filling an image. Common options includebox,lanczos,catmullRom,mitchellNetravali,linear, ornearestNeighbor. Default isbox.Filter Description boxSimple and fast averaging filter appropriate for downscaling lanczosHigh-quality resampling filter for photographic images yielding sharp results catmullRomSharp cubic filter that is faster than the Lanczos filter while providing similar results mitchellNetravaliCubic filter that produces smoother results with less ringing artifacts than CatmullRom linearBilinear resampling filter, produces smooth output, faster than cubic filters nearestNeighborFastest resampling filter, no antialiasing Refer to the source documentation for a complete list of available resampling filters. If you wish to improve image quality at the expense of performance, you may wish to experiment with the alternative filters.
EXIF data
These are the default settings for extracting EXIF data from images:
imaging:
exif:
disableDate: false
disableLatLong: false
excludeFields: ''
includeFields: ''
[imaging]
[imaging.exif]
disableDate = false
disableLatLong = false
excludeFields = ''
includeFields = ''
{
"imaging": {
"exif": {
"disableDate": false,
"disableLatLong": false,
"excludeFields": "",
"includeFields": ""
}
}
}
- disableDate
- (
bool) Whether to disable extraction of the image creation date/time. Default isfalse. - disableLatLong
- (
bool) Whether to disable extraction of the GPS latitude and longitude. Default isfalse. - excludeFields
- (
string) A regular expression matching the tags to exclude when extracting EXIF data. - includeFields
- (
string) A regular expression matching the tags to include when extracting EXIF data. To include all available tags, set this value to".*".
To improve performance and decrease cache size, Hugo excludes the following tags: ColorSpace, Contrast, Exif, Exposure[M|P|B], Flash, GPS, JPEG, Metering, Resolution, Saturation, Sensing, Sharp, and WhiteBalance.
To control tag availability, change the excludeFields or includeFields settings as described above.
Last updated:
January 26, 2026
:
content: Refactor pages related to image processing (d0e448a14)
Improve this page