Questions tagged [gm]

Use this tag for questions regarding usages of the gm library for node.js

gm, and for node.js, is a node.js library that can execute native commands for image processing.

119 questions
1
vote
0 answers

issue while using jimp and gm npm modules to buffer the same image in discord js bot

hello i tried using gm and jimp modules to buffer the same image on discord.js jimp for adding img(the user avatar) and gm for adding a text (the user username) but i fail because i cannot find a way to make gm identify the buffer…
midoune
  • 13
  • 3
1
vote
0 answers

How can I stitch two images, according to predefined polygon with nodejs (gm)

What am I trying to do? I'm trying to stitch 2 images of the same size, according to predefined polygon using nodejs(gm). I succeeded to do so, but it is very cumbersome and time consuming. Looking for a shorter and better way to do so. In details I…
Noam Zweig
  • 11
  • 1
1
vote
0 answers

Get colour space of an image in NodeJS

I need to loop through a list of JPEG images to see if their colorspace is RGB. How do I do a check? I see the GM documents and it states the way to set the colourspace not get. How do I get the colourspace of an image?
Moses Liao GZ
  • 1,556
  • 5
  • 20
  • 45
1
vote
1 answer

Image resize using GraphicMagick gm with 'convert' is resulting in inconsistent image

I have been trying to resize images using node.js gm module. It did work for most of the images.But when I try to resize few images, the background color and the text in the image is overlapping.My requirement is to create images of different…
merla
  • 489
  • 1
  • 5
  • 12
1
vote
2 answers

Resize image to exact size by maintaining aspect ratio nodejs

I want to resize image to an exact size by maintaining aspect ratio and filling the empty space with transparency using nodejs. I am able to do it using canvas. But due to some server os issues I can not use canvas. I tried with imageMagick and gm.…
LokiKartik
  • 91
  • 10
1
vote
0 answers

Image Magick resize of large images in lambda is resulting in Error "Stream yields empty buffer"

I have been trying to resize the images using image magick in lambda. It is working for smaller images.But if the image size is larger, I am getting below error Error: Stream yields empty buffer at Socket.
merla
  • 489
  • 1
  • 5
  • 12
1
vote
1 answer

Nodejs gm library - how to create convert command for multiple images to be layered in sequence

What is the equivalent nodejs gm library https://github.com/aheckmann/gm command to this imagemagick cli command? imagemagick cli command to layer several images on a transparent background: convert -size 669x122 xc:none img1.jpg -geometry +223+0…
Zelf
  • 1,723
  • 2
  • 23
  • 40
1
vote
1 answer

Node GM (GraphicsMagick) - Loop based image generation

Using GM (GraphicsMagick) in NodeJS I wanted to generate some image content via using loops with commands such as drawPoint to set pixel data however i am not sure on the best practice to do so. The code i have tested with loops works however it is…
Bluedragon
  • 15
  • 4
1
vote
0 answers

Using node.js gm to create circle image

I have created a function that creates an initials avatar using node.js gm. But it always creates a square-shaped avatar, I want it to create a circle shaped image. I have already tried other solutions but they seem to be not working. I want to use…
Saad Zafar
  • 21
  • 3
1
vote
1 answer

Nodejs file attachement handler

I am looking for resources for file attachment handling in nodeJs. I am from rails background so there are two popular resources which do things out of the box for developers ex. carrier wave and the paperclip. they provide pretty straight…
Rahul Sharma
  • 1,393
  • 10
  • 19
1
vote
2 answers

gm node.js can't resize images of large filesize

I am using gm for node.js on linux server with express.js . It works fine with images less than 2MB filesize. But the moment it exceeds that the code stops working. Here's the code gm('public/'+article.page.image) .resize(width,height) …
1
vote
1 answer

NodeJS/gm: Promises with asynchronous calls

I'm using gm to manipulate some images in my nodeJS application. This is how my function looks like. As you can see there is a switch for some manipulation (in this example: rotation). gmStream is created and after the switch .stream() and pipe()…
user3142695
  • 15,844
  • 47
  • 176
  • 332
1
vote
0 answers

looping through folder of images and resizing using node gm

this code leads to just the a single image being written to output(6175710.jpg). Instead I would like all three. What is incorrect in my code. Im using node gm module. see my implementation: fs.readdir(__dirname + '/../images/master/',…
jasan
  • 11,475
  • 22
  • 57
  • 97
1
vote
0 answers

Error: Stream yields empty buffer when reducing picture quality with gm on AWS Lambda

i've read all other topics and tried a few answers, but i can't seem to figure out why i get this error. My code gets the uploaded pic in a S3 bucket, reduces the quality and puts it in a second bucket. Plain and simple. With small/medium images…
1
vote
1 answer

Nodejs: Decoding base64Image Data and process it with gm "size error spawn E2BIG" error

I have made the following string where I try to decode a base64 encoded image and process it via gm using buffer: const gm=require('gm'); const URLSafeBase64 = require('urlsafe-base64'); const iconv = require('iconv-lite'); const…
Dimitrios Desyllas
  • 9,082
  • 15
  • 74
  • 164