-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to the handling of images with multiple alpha channels #2266
Comments
Hi, are you able to provide a sample input image? As an aside, the use of |
Here is my image. |
This input TIFF image has 5 channels, RGB and what appears to be two alpha channels, which is unusual. The raw, uncompressed output pixel data has five channels, for example: const { info } = await sharp('Shipyard Cranes Masked (8).tif')
.raw()
.toBuffer(); produces: {
format: 'raw',
width: 3363,
height: 4000,
channels: 5,
premultiplied: false,
size: 67260000
} sharp currently doesn't understand "5 channel RGB" and does not know how treat channels 4 and 5, so using const { info } = await sharp('Shipyard Cranes Masked (8).tif')
.ensureAlpha()
.raw()
.toBuffer(); produces: {
format: 'raw',
width: 3363,
height: 4000,
channels: 6,
premultiplied: false,
size: 80712000
} There are two possible improvements here.
|
I don't use |
Hi, I use sharp v0.25.4.
I load a 16bit tiff and want to display on web canvas. Web chanvas require 4 channel containning alpha. In my code, I write it like this:
I see
info
is still 6 channel but not 4. Then my code throw an error which can not create ImageData. Is it a bug?The text was updated successfully, but these errors were encountered: