Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nodejs read image data

Is there any library to read image data of a jpeg ?

I would like to get the pixel of a jpeg.

I only find library like node-jpeg or gm but they don't provide images data.

like image 522
Charles Avatar asked Jul 06 '12 06:07

Charles


People also ask

How do you decode a binary buffer to an image in node JS?

from(data); //or Buffer. from(data, 'binary') let imgData = new Blob(binary. buffer, { type: 'application/octet-binary' }); let link = URL. createObjectURL(imgData); let img = new Image(); img.

What is sharp in node JS?

sharp is a popular Node. js image processing library that supports various image file formats, such as JPEG, PNG, GIF, WebP, AVIF, SVG and TIFF. In this tutorial, you'll use sharp to read an image and extract its metadata, resize, change an image format, and compress an image.


1 Answers

You could do this with the node-imagemagick module. (see Opening images on NodeJS and finding out width/height).

Also, if you prefer accessing the EXIF metadata, there is node-exif.

like image 131
mgherkins Avatar answered Oct 13 '22 01:10

mgherkins