You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you say 32-bits per channel, do you mean an 8-bit per pixel image with 4 channels? If so, you may be looking for quantisation, which is not supported.
As input any color type is accepted (grayscale, rgb, palette, grayscale with alpha, rgb with alpha) but 8 bit per sample (channel) is the only supported bit depth. Interlaced mode is not supported.
Hello @jdalton, the following code seems to produce PNG output images from sharp that can be parsed by pngjs, at least when testing locally with a few different formats from the fixtures.
This was meant to be used to solve this issue: peterbraden/node-opencv#436
So sharp should remove alpha-transparency completely,
including the channel itself so opencv can handle the matching.
Activity
[-]Change depth[/-][+]Change bits per channel[/+]lovell commentedon Aug 2, 2016
At the end of the processing pipeline, before generating the output image, 16-bit pixel values are cast to 8-bit - see
sharp/src/pipeline.cc
Lines 675 to 677 in 7ada9db
When you say 32-bits per channel, do you mean an 8-bit per pixel image with 4 channels? If so, you may be looking for quantisation, which is not supported.
jdalton commentedon Sep 13, 2016
I ran into what I think is a related issue with compatibility with pngjs for
Is there was a way to output a compatible png?
lovell commentedon Sep 13, 2016
Hello @jdalton, the following code seems to produce PNG output images from
sharpthat can be parsed bypngjs, at least when testing locally with a few different formats from the fixtures.Perhaps a particularly tricky or complex input image is causing problems?
jdalton commentedon Sep 13, 2016
Ah yeah. Turns out it was a OptiPNG optimization causing the issue.
lovell commentedon Sep 13, 2016
@strarsis has your original question been answered?
strarsis commentedon Sep 13, 2016
This was meant to be used to solve this issue: peterbraden/node-opencv#436
So sharp should remove alpha-transparency completely,
including the channel itself so opencv can handle the matching.
lovell commentedon Sep 13, 2016
@strarsis If OpenCV's matchTemplate feature doesn't support an alpha-transparency channel then I'd suggest using flatten() to remove it.
strarsis commentedon Sep 13, 2016
Thanks, this works. And for the other way around
(make image 32bit (with alphatransparency)), #554 (comment) can be used.