Hugo: JPG image resize processing result looks bad

Created on 13 Jan 2020  路  4Comments  路  Source: gohugoio/hugo

Tried using the inbuilt image resize processing but the results look poor to me. The following images were resized from 1200 pixels wide to 1250 with quality set to 100 to remove that as a factor. I used hugo and gimp to compare the images.

Resized in Hugo:
image

Resized in gimp:
image

What is Hugo using to do the image resizing? Using v0.59.1.

NeedsUserFeedback

Most helpful comment

It's gift, yes. You may want to try some other resample filter, I suspect the default was chosen for speed and not quality: https://gohugo.io/content-management/image-processing/#resample-filter

All 4 comments

Jagged edges appear on images that are both reduced in size and increased in size.

Looking at the code it looks like github.com/disintegration/gift, that correct?

It's gift, yes. You may want to try some other resample filter, I suspect the default was chosen for speed and not quality: https://gohugo.io/content-management/image-processing/#resample-filter

RTFM!

For this image, Guassian and Linear both look great and Box and NearestNeighbor look bad.

I checked in GIMP and interpolation was set to "Cubic" which sounds box like to a layman.

Thanks @bep!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vielmetti picture vielmetti  路  3Comments

antifuchs picture antifuchs  路  3Comments

digitalcraftsman picture digitalcraftsman  路  3Comments

carandraug picture carandraug  路  3Comments

VoidingWarranties picture VoidingWarranties  路  3Comments