bimg
bimg copied to clipboard
Moiré patterns on resize
The resize method in bimg gives moiré patterns when resizing from 1920x1080 to 480x270 with the following original image:
When resizing to 480x270 there are moiré patterns:
When resizing to 481, the moiré pattern is gone:
Code used
originalImageBytes, err := bimg.Read("moire.jpg")
newImageBytes, err := bimg.NewImage(originalImageBytes).Process(bimg.Options{
Width: int(requestedWidth),
StripMetadata: true,
})
Maybe related to shrink-on-load in libjpeg-turbo:
https://github.com/lovell/sharp/issues/883