Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Discussion options

You must be logged in to vote

Hi @Julianiolo,

It's harmless debugging output, it shows you are computing some pixels many times.

You are doing effectively this:

final = mip.resize(0.5).resize(0.5).resize(0.5)

So there's a chain of repeated resize operations. They will all execute, so the final level of the resize will compute some pixels (in this case) three times over.

The trick is to use copy_memory() to make sure the result of each resize stage gets reused.

https://www.libvips.org/API/current/cpp/classVImage.html#a852b430469f8b63648cd8c006314cd72

Something like:

final = mip.resize(0.5).copy_memory().resize(0.5).copy_memory().resize(0.5)

Now each resize is generated to an area of RAM and those pixels are reused.

Y…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Julianiolo
Comment options

Answer selected by Julianiolo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants
Converted from issue

This discussion was converted from issue #4735 on November 21, 2025 18:33.