ermig1979 / Simd

C++ image processing and machine learning library with using of SIMD: SSE, AVX, AVX-512, AMX for x86/x64, VMX(Altivec) and VSX(Power7) for PowerPC, NEON for ARM.
http://ermig1979.github.io/Simd
MIT License
2.05k stars 409 forks source link

Supporting multi-byte grayscale PNG images? #241

Closed crm-mtz closed 1 year ago

crm-mtz commented 1 year ago

HI there,

So I'm trying out the current framework. After discovering Simd only supports PNG's lossless file-format, I converted my images accordingly. My input PNG's are 16-bit grayscale pixels.

So, the Framework's API is able to decode and read in my image file, but it has a funny output, according to gdb:

$1 = {width = 1124, height = 1364, stride = 4512, format = Simd::View::Rgba32, data = 0x555569994a00 "", _owner = true}

The output in bold was unexpected. I was hoping the View would be set to ::Int16 and the stride would be 1124*2 = 2248 So, am I to understand that my 16-bit grayscale image is now RGB, with A channels?

Is there a plan to support the pure, multi-byte grayscale pixel plane in the near-future?
If not, I'd be happy to add this in.

Thanks, Charles.

ermig1979 commented 1 year ago

Hi! Simd supports loading only images with 8-bit per channel.