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) Determines 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. Default isSmart, which identifies the most interesting area of the image based on the smart cropping algorithm as implemented in thesmartcrop.jslibrary. - bgColor
- (
string) Specifies the background color for the resulting image. This applies when converting an image with transparency to a format that does not support it, such as a PNG to JPEG conversion. The value must be an RGB hexadecimal color. Default is#ffffff. - compression
- New in v0.153.5
- (
string) Defines the compression method used when encoding the image, eitherlossyorlossless. The lossless method applies only to WebP images. Default islossy. - hint
- (
string) Sets predefined encoding parameters specifically for WebP images. Options includedrawing,icon,photo,picture, ortext. This is equivalent to the-presetflag for the cwebp encoder.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) Determines the output quality for JPEG and WebP images when usinglossycompression. Higher values improve image clarity while lower values reduce file size. The value must be a whole number between1and100inclusive. Default is75. - resampleFilter
- (
string) Selects the algorithm used to calculate new pixels when resizing an image. Default isbox. Commonly used resampling filters include: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:
December 29, 2025
:
content: Document image compresssion option (013fee46f)
Improve this page