I am looking for a 16 bit jpg decoder

I’m having a hard time finding a 16-bit jpg decoder. Does anyone know one I have fast-png for png images and that’s exactly what I need.

import{decode} from 'fast-png';

const arrayBuffer = await(await fetch('./resources/textures/depth1.png')).arrayBuffer();				
const imageData = await decode(arrayBuffer); //16 bit decoder
const data = imageData.data;

This works great, even with very large image files. However, png’s have the disadvantage that they use significantly more memory and take longer to load than jpg, so I’m looking for an equivalent solution for jpg. I haven’t found anything that is comparable to fast-png for jpg files.

maybe this? since libjpeg is like a golden standard, if it cant do something with jpeg - nothing can.

1 Like

I took a look at your recommendation after solving two other challenges. I only work with modules and therefore need importable modules. libjpeg-turbojs seems to be very powerful. I see with libjpegturbojs and libjpegturbowasm in the dist folder unfortunately only two scripts to be included in the html file. Do you also know an ES6 module variant?