Questions tagged [jimp]

Jimp (JavaScript Image Manipulation Program) is an image processing library for Node written entirely in JavaScript, with zero native dependencies.

Jimp (JavaScript Image Manipulation Program) is an image processing library for Node written entirely in JavaScript, with zero native dependencies.

104 questions
2
votes
1 answer

How to Use Jimp to Resize Image for Upload without Refreshing in Node.js

I'm trying to resize a file server-side using Jimp before uploading to Cloudinary in node.js with the following controller: exports.uploadImage = async (req, res) => { if (!req.files) { return res.status(400).json({ msg: 'No file to upload'…
dikuw
  • 1,134
  • 13
  • 22
2
votes
1 answer

is there way to compare two images using jimp for node js

I am a beginner in node js, so I am looking for a way to compare two images using jimp for my project. I want to know is that possible, if it is possible the code and method of doing it, or is there another way to do that.
2
votes
2 answers

Jimp error: No matching constructor overloading was found

I'm trying to create a meme command with my bot that uses Jimp to add text onto an image the user sends with the command. It works, but whenever something doesn't go to plan (e.g. someone not sending the image, someone not sending the text that…
lqshkiwi
  • 21
  • 1
  • 2
2
votes
4 answers

(node:23042) UnhandledPromiseRejectionWarning: Error: Could not find MIME for Buffer

I am trying to take an image URL using express in Typescript, filter it and send the image back as response. Here is the endpoint: app.get("/filteredimage/", async (req, res) =>{ try{ let {image_url} = req.query; if(!image_url){ return…
2
votes
0 answers

printing emojis on images using jimp

I am trying to print emojis, let's say using .print() onto images with jimp but when .write() the image the emojis show up as ??. Is there a way to print emojis on images using jimp?
Syntle
  • 5,168
  • 3
  • 13
  • 34
2
votes
0 answers

Node JS memory leak on linux

Hello I have a memory leak in node js that happens only in production mode on my vps which runs on a Ubuntu 18.04.3 LTS. In dev mode on Windows 10 this memory leaks does not occure. The code with problem on linux is the following: async…
S. Georgian
  • 143
  • 1
  • 2
  • 11
2
votes
1 answer

how to embed an image in a JSON response

I'm using Jimp to read in a JSON string that looks like this: As you can see the image node is a base64-encoded JPEG. I'm able to succesfully convert it to a TIFF and save it: Jimp.read(Buffer.from(inputImage, "base64"), function(err, image) { …
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062
1
vote
0 answers

Can jimp handle slightly broken images?

I've just moved away from using sharp because it has problems with BMP images some of my users try to load, and I picked jimp. All good, except it's not very tolerant with images that aren't quite right. One of my users tried to load a PNG file from…
Phil Cairns
  • 758
  • 4
  • 15
1
vote
0 answers

Jimp.read a png string?

I'm pulling a png image string from s3 that looks like �PNG\r\n' + '\x1A\n' + '\x00\x00\x00\rIHDR\x00\x00\x02\x00\x00\x00\x02\x00\b\x02\x00\x00\x00... I'm trying to manipulate this image with Jimp const buffer = Buffer.from(imageString); const…
Shakil
  • 11
  • 1
1
vote
0 answers

Is there any way to specify alternate font in JIMP?

I'm using image.print function of JIMP and the font I'm using doesn't support languages other than English (It just returns ???). I was wondering if there is any way that, in JIMP, I can specify an alternative font so that if first font doesn't…
1
vote
0 answers

How to get the transparent region of image A and paste it on top of image B

I have image A ( a png) and image B ( a jpg ). image A and B are the same image, with the exception that image B has better resolution of image A because it's passed through a enhancing resolution api. The problem is that since the API returns a…
1
vote
0 answers

How can I use Jimp in React Native? If not, is there another compatible package that offers similar functionality?

I am working on a project where I need to iterate over each pixel or turn the image into a 2D array of dictionaries containing red, green and blue values found in each pixel. I have not yet found a way to do this without Jimp. Is there a…
Arca Ege Cengiz
  • 315
  • 3
  • 16
1
vote
1 answer

Resize base64 image and get the return value out of the function in nodejs

async function imgResize(data){ // Convert base64 to buffer => { if (err) throw new Error(err); console.log("Original image size:…
Taz
  • 15
  • 3
1
vote
1 answer

How do I change the color of a pixel properly?

I'm using jimp to manipulate an image. I'm trying to make something like a selection rectangle that when drawn has a transparent color (#BBBBBBBB). How do I calculate the RGB values I need to set for the pixels? I want to keep the old color and put…
ProGamer2711
  • 451
  • 1
  • 5
  • 18
1
vote
1 answer

NodeJs, Express, Jimp: how do I load a font and read a file inside of a Promise?

Using nodejs, express, Jimp. I cannot get Jimp to ".print" to an image and ".writeAsync", or more accurately I think the problem is I cant ".loadFont" and ".read". I have tried using ".loadFont" both inside and outside of ".read" by nesting. I can…
Loom
  • 21
  • 2