Extend the 10,000-pixel limit for extend() to standard dimension limit
Author: neaveCreated Sep 12, 2026Updated Sep 13, 2026
Labelsbugready-to-ship
The 10,000-pixel limit added to extend() in Sharp 0.35.3 is blocking us from upgrading. Our workflow needs larger padding values, and these have worked fine in previous versions.
Here’s a simple example:
await sharp({
create: {
width: 1,
height: 1,
channels: 3,
background: 'white'
}
})
.extend({ left: 20000, background: 'black' })
.png()
.toBuffer();This only produces a narrow, 20,001-pixel image, but the new validation rejects it.
I found the commit that introduced this, but couldn’t find any discussion about why 10,000 was chosen. Is there a technical reason for that number?
Protective defaults make sense, but this feels like an arbitrary cutoff without a way around it. Neither limitInputPixels: false nor unlimited: true bypasses it.
Could we have a way to raise or disable this limit, similar to limitInputPixels?
Source: lovell/sharp