Optimize resizing with Resize-on-load
masterTo significantly speed up resizing and improve accuracy, you should place #resize_* operations as the first operation in your processing chain. This allows the processor to use vips_thumbnail(), which performs resize-on-load.
Avoid this pattern (no resize-on-load):
ImageProcessing::Vips
.source(image)
.colourspace(:grey16)
.resize_to_limit(400, 400)Use this pattern (utilizes resize-on-load):
ImageProcessing::Vips
.source(image)
.resize_to_limit(400, 400)
.colourspace(:grey16)# GOOD: utilizes resize-on-load
ImageProcessing::Vips
.source(image)
.resize_to_limit(400, 400)
.colourspace(:grey16)