Recommended transform order #4486
Closed
kipcole9
started this conversation in
Help wanted
Replies: 2 comments
-
Hi @kipcole9, No, sorry, it looks plausible but it's mostly wrong. There's a note about this in the dev checklist: I'd order as thumbnail, then area filters (sharpen etc.), then point operations. |
Beta Was this translation helpful? Give feedback.
0 replies
-
And that's why I asked ! Thanks again John. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm supporting a collaborator as he implements an image transform and image proxy using libvips via Elixir Image which I maintain.
To take best advantage of
libvips
pipelining I want to make sure the order of transforms is as good as it can be. I know I've seen something on this in bothlibvips
and sharp but I can find neither now. ChatGPT offers the following - does that seem correct?Use VipsImage.thumbnail() or load with shrink-on-load flags (e.g., VipsForeignLoadOption::shrink with JPEG).
✅ Reduces input size early, saving downstream processing.
Reduce working data early in the pipeline.
✅ Efficiently drops unneeded pixels from processing.
Perform these after reducing size but before color transforms.
Downsample images early (ideally at load) if possible.
✅ Minimizes pixel data for later operations.
Convert to the working color space (e.g., sRGB → linear) only if necessary, and delay until needed.
These operate per-pixel and are fast and parallel-friendly.
If compositing, try to minimize the resolution and use the same color space beforehand.
Save as the last step. Use streaming-friendly formats when possible (JPEG, PNG).
Beta Was this translation helpful? Give feedback.
All reactions